diff --git a/appdaemon.yaml b/appdaemon.yaml index e4212af..0f56e83 100755 --- a/appdaemon.yaml +++ b/appdaemon.yaml @@ -1,4 +1,5 @@ appdaemon: + import_method: expert latitude: 30.250968 longitude: -97.748193 elevation: 150 diff --git a/apps/cubes/cube.py b/apps/cubes/cube.py index e8f44be..dd417e2 100644 --- a/apps/cubes/cube.py +++ b/apps/cubes/cube.py @@ -1,16 +1,11 @@ import logging -import sys from enum import Enum -from pathlib import Path from typing import Literal, Optional from appdaemon.plugins.hass.hassapi import Hass from appdaemon.plugins.mqtt.mqttapi import Mqtt from pydantic import BaseModel, Field, TypeAdapter, field_validator - -rc_path = (Path(__file__).resolve().parents[1] / 'room_control').as_posix() -sys.path.insert(0, rc_path) -from console import console, setup_component_logging +from room_control.console import setup_component_logging class Side(int, Enum): @@ -20,13 +15,10 @@ class Side(int, Enum): front = 3 left = 4 bottom = 5 - + Actions = Literal[ - '', 'wakeup', - 'slide', 'shake', - 'rotate_left', 'rotate_right', - 'flip180', 'flip90' + '', 'wakeup', 'slide', 'shake', 'rotate_left', 'rotate_right', 'flip180', 'flip90' ] @@ -104,9 +96,9 @@ class AqaraCube(Hass, Mqtt): else: self.log( f'{event_name} on [topic]{data.topic}[/], Action: "[yellow]{str(action)}[/]"', - level='DEBUG' + level='DEBUG', ) - if (arg := self.args.get(action, False)): + if arg := self.args.get(action, False): self.action_handler(action=action, description=arg) elif handler := getattr(self, f'handle_{action}', None): handler(data.payload) diff --git a/apps/room_control b/apps/room_control index d42afb1..124ff5c 160000 --- a/apps/room_control +++ b/apps/room_control @@ -1 +1 @@ -Subproject commit d42afb1829359050fa7b3771a46f886bb5ea05e3 +Subproject commit 124ff5c227610792dd7c9f73c29660555570276b diff --git a/apps/rooms/bathroom.yaml b/apps/rooms/bathroom.yaml index a4a9931..79bdcda 100644 --- a/apps/rooms/bathroom.yaml +++ b/apps/rooms/bathroom.yaml @@ -35,7 +35,7 @@ bathroom: color_temp: 250 bathroom_button: - module: button + module: room_control class: Button dependencies: - bathroom @@ -45,7 +45,7 @@ bathroom_button: ref_entity: light.bathroom bathroom_motion: - module: motion + module: room_control class: Motion dependencies: - bathroom diff --git a/apps/rooms/bedroom.yaml b/apps/rooms/bedroom.yaml index 3ed62fa..309d416 100644 --- a/apps/rooms/bedroom.yaml +++ b/apps/rooms/bedroom.yaml @@ -77,7 +77,7 @@ bedroom: sleep: input_boolean.sleeping bedroom_buttons: - module: button + module: room_control class: Button dependencies: - bedroom @@ -89,7 +89,7 @@ bedroom_buttons: - Bedroom Button 2 bedroom_motion: - module: motion + module: room_control class: Motion dependencies: - bedroom diff --git a/apps/rooms/closet.yaml b/apps/rooms/closet.yaml index 2c3a704..0b237c1 100644 --- a/apps/rooms/closet.yaml +++ b/apps/rooms/closet.yaml @@ -28,7 +28,7 @@ closet: color_temp: 400 closet_motion: - module: motion + module: room_control class: Motion dependencies: - closet diff --git a/apps/rooms/kitchen.yaml b/apps/rooms/kitchen.yaml index a1ae167..9317209 100755 --- a/apps/rooms/kitchen.yaml +++ b/apps/rooms/kitchen.yaml @@ -40,7 +40,7 @@ kitchen: brightness: 25 kitchen_button: - module: button + module: room_control class: Button dependencies: - kitchen @@ -50,7 +50,7 @@ kitchen_button: ref_entity: light.kitchen kitchen_motion: - module: motion + module: room_control class: Motion dependencies: - kitchen diff --git a/apps/rooms/laundry.yaml b/apps/rooms/laundry.yaml index 1963f77..f6b9004 100644 --- a/apps/rooms/laundry.yaml +++ b/apps/rooms/laundry.yaml @@ -28,7 +28,7 @@ laundry: color_temp: 400 laundry_motion: - module: motion + module: room_control class: Motion dependencies: - laundry diff --git a/apps/rooms/living_room.yaml b/apps/rooms/living_room.yaml index 453f256..67ebf2e 100644 --- a/apps/rooms/living_room.yaml +++ b/apps/rooms/living_room.yaml @@ -69,7 +69,7 @@ living_room: brightness: 25 front_door: - module: door + module: room_control class: Door dependencies: - living_room @@ -78,7 +78,7 @@ front_door: door: binary_sensor.front_contact living_room_button: - module: button + module: room_control class: Button dependencies: - living_room @@ -88,7 +88,7 @@ living_room_button: ref_entity: light.living_room living_room_motion: - module: motion + module: room_control class: Motion dependencies: - living_room diff --git a/requirements.txt b/requirements.txt index 2888ace..c7f3a8b 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,6 @@ # matplotlib --only-binary=:matplotlib: # jupyterlab --only-binary=:jupyterlab: rich -pydantic \ No newline at end of file +pydantic + +# /conf/apps/room_control \ No newline at end of file