bettwaage-sidequest #2

Merged
m.giller merged 38 commits from bettwaage-sidequest into master 2024-06-07 23:38:56 +02:00
Showing only changes of commit dbf11551c5 - Show all commits

View file

@ -7,6 +7,7 @@ from ..hue import hue
refresh_every_seconds: int = 15 # Every x seconds devices are polled again
trigger_away_after_seconds: int = 60 # After all away-devices are gone for x seconds
away_triggered = False
away_devices = ["B2:06:77:EE:A9:0F"] # Max' iPhone
macaddresses_to_track = ["B2:06:77:EE:A9:0F"] # Max' iPhone
@ -30,9 +31,9 @@ def get_all_devices() -> list:
return devices
def get_specific_device(mac_adress: str) -> dict:
def get_specific_device(mac_address: str) -> dict:
return fritz_api.call_action(
"Hosts", "GetSpecificHostEntry", NewMACAddress=mac_adress
"Hosts", "GetSpecificHostEntry", NewMACAddress=mac_address
)
@ -46,9 +47,13 @@ def check_for_change():
break
# Execute away mode
global away_triggered
if all_away:
if not away_triggered:
away_triggered = True
hue.in_room_deactivate_lights("Max Zimmer")
else:
away_triggered = False
async def track_network_devices():
global devices_last_online