<reponame>athaun/Python-ai-assistant
import re
import time
import requests
import json

from jarvis.skills.skill import AssistantSkill

class LightSkills (AssistantSkill):
    
    @classmethod
    def toggle_light(cls, voice_transcript, skill, **kwargs):
        """
        Toggles ceiling light on or off.
        """
        try:
            r = requests.post("http://192.168.1.20:5000/", 
                data=b"lightSwitch",
            )
            cls.response("TOGGLED LIGHT")
        except Exception as e:
            cls.console(error_log=e)
            cls.response("Unable to toggle light.")

import re
import time
import requests
import json

from jarvis.skills.skill import AssistantSkill

class LightSkills (AssistantSkill):
    
    @classmethod
    def toggle_light(cls, voice_transcript, skill, **kwargs):
        """
        Toggles ceiling light on or off.
        """
        try:
            r = requests.post("http://192.168.1.20:5000/", 
                data=b"lightSwitch",
            )
            cls.response("TOGGLED LIGHT")
        except Exception as e:
            cls.console(error_log=e)
            cls.response("Unable to toggle light.")
Toggles ceiling light on or off.