From 852254e80f58929c746b4b1cee1c4d1b5337b9c3 Mon Sep 17 00:00:00 2001 From: Jonathan Segev Date: Fri, 10 Apr 2026 17:42:32 -0400 Subject: [PATCH] Store LyricPriority object in priorities_dict The get_thermostat_rooms method now stores the full LyricPriority object keyed by device MAC address, making priority_type and selected_rooms accessible to consumers without additional API calls. --- aiolyric/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aiolyric/__init__.py b/aiolyric/__init__.py index 5980d80..5a1fb29 100644 --- a/aiolyric/__init__.py +++ b/aiolyric/__init__.py @@ -28,6 +28,7 @@ def __init__( self._devices_dict: dict = {} self._locations: list[LyricLocation] = [] self._locations_dict: dict = {} + self._priorities_dict: dict[str, LyricPriority] = {} self._rooms_dict: dict = {} @property @@ -55,6 +56,11 @@ def locations_dict(self) -> dict: """Return the locations dict.""" return self._locations_dict + @property + def priorities_dict(self) -> dict[str, LyricPriority]: + """Return the priorities dict, keyed by device MAC address.""" + return self._priorities_dict + @property def rooms_dict(self) -> dict[str, dict[str, LyricRoom]]: """Return the rooms dict.""" @@ -105,6 +111,7 @@ async def get_thermostat_rooms( # device id in the priority payload refers to the mac address of the device mac_id = priority.device_id + self._priorities_dict[mac_id] = priority self._rooms_dict[mac_id] = {} # add each room to the room dictionary. Rooms contain motion, temp, and humidity averages for all accessories in a room