This repository has been archived on 2023-06-09. You can view files and clone it, but cannot push or open issues or pull requests.
jarvis-server/jarvis/skills/productivity/homeassistant/__init__.py

18 lines
611 B
Python
Raw Normal View History

2021-09-12 21:50:30 +02:00
from jarvis.skills import Skill, SkillRegistering
from jarvis.skills.decorators import intent_file_handler
from jarvis.skills.productivity.homeassistant import homeassistant_client
class HomeAssistantSkill(Skill, metaclass=SkillRegistering):
def __init__(self, data=dict):
super().__init__("HomeAssistantSkill", data)
homeassistant_client.init()
@intent_file_handler("homeassistant_turn_on.intent", "HATurnOn")
def handle_turn_on(self, data):
print(homeassistant_client.find_switchable_entity(data['entity']))
def create_skill(data):
return HomeAssistantSkill(data)