expert import mode
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
appdaemon:
|
||||
import_method: expert
|
||||
latitude: 30.250968
|
||||
longitude: -97.748193
|
||||
elevation: 150
|
||||
|
||||
@@ -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)
|
||||
|
||||
Submodule apps/room_control updated: d42afb1829...124ff5c227
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -28,7 +28,7 @@ closet:
|
||||
color_temp: 400
|
||||
|
||||
closet_motion:
|
||||
module: motion
|
||||
module: room_control
|
||||
class: Motion
|
||||
dependencies:
|
||||
- closet
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -28,7 +28,7 @@ laundry:
|
||||
color_temp: 400
|
||||
|
||||
laundry_motion:
|
||||
module: motion
|
||||
module: room_control
|
||||
class: Motion
|
||||
dependencies:
|
||||
- laundry
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,4 +3,6 @@
|
||||
# matplotlib --only-binary=:matplotlib:
|
||||
# jupyterlab --only-binary=:jupyterlab:
|
||||
rich
|
||||
pydantic
|
||||
pydantic
|
||||
|
||||
# /conf/apps/room_control
|
||||
Reference in New Issue
Block a user