From a524094348c53f3c0ccf3aab7c6149c60b7003bb Mon Sep 17 00:00:00 2001 From: Ali Bosworth Date: Sat, 21 Feb 2026 18:25:04 -0800 Subject: [PATCH 1/2] Fix update_priority functionality to support T9 and T10 with sensors As per the [lyric API docs](https://developer.honeywellhome.com/lyric/apis) the "Set Room Priority" endpoint is used via a PUT not a POST. It was not working as a POST (maybe it did previously. This commit switches to a PUT and also stops sending `selectedRooms` when rooms is not passed into update_priority. During debugging the broken functionality I noticed `selectedRooms` was being passed even when the priorityType was something other than `PickARoom`. Note: setting priorityType to `WholeHouse` appears to work however on re-fetch it never persists. The Resideo app does not expose the WholeHouse option (even when multiple rooms with sensors are configured) so I suspect this is a feature that is not fully built out on the API side. --- aiolyric/__init__.py | 10 ++++++---- aiolyric/client.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/aiolyric/__init__.py b/aiolyric/__init__.py index 5980d80..907fc86 100644 --- a/aiolyric/__init__.py +++ b/aiolyric/__init__.py @@ -198,21 +198,23 @@ async def update_priority( location: LyricLocation, device: LyricDevice, priority_type: str, - rooms: list[int], + rooms: list[int] | None = None, ) -> ClientResponse: """Update Priority.""" self.logger.debug("Update Priority") - priority = { + priority: dict = { "priorityType": priority_type, - "selectedRooms": rooms, } + if rooms is not None: + priority["selectedRooms"] = rooms + data = {"currentPriority": priority} self.logger.debug(data) - return await self._client.post( + return await self._client.put( f"{BASE_URL}/devices/thermostats/{device.device_id}/priority?apikey={self._client_id}&locationId={location.location_id}", json=data, ) diff --git a/aiolyric/client.py b/aiolyric/client.py index f787ccd..dca9af0 100644 --- a/aiolyric/client.py +++ b/aiolyric/client.py @@ -45,6 +45,18 @@ async def post( **kwargs, ) + async def put( + self, + url: str, + **kwargs, + ) -> ClientResponse: + """Make a PUT request.""" + return await self.request( + "PUT", + url, + **kwargs, + ) + async def request( self, method: str, From 19383b4102e61da971b9cfc5c14dd9549af04243 Mon Sep 17 00:00:00 2001 From: Ali Bosworth Date: Sat, 21 Feb 2026 18:45:41 -0800 Subject: [PATCH 2/2] Add update_priority calls to tests --- tests/conftest.py | 7 +++++++ tests/test_init.py | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 9795498..7bbbe96 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -70,6 +70,13 @@ def mock_aioresponse(): repeat=True, ) + mocker.put( + f"{BASE_URL}/devices/thermostats/LCC-00A01AB1ABCD/priority?apikey=test&locationId=123456", + payload=RESPONSE_JSON_BASIC, + status=200, + repeat=True, + ) + yield mocker diff --git a/tests/test_init.py b/tests/test_init.py index 025b1ff..bc7f2bf 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -66,3 +66,22 @@ async def test_lyric( lyric.devices[0], "auto", ) + + await lyric.update_priority( + lyric.locations[0], + lyric.devices[0], + "PickARoom", + [0, 1], + ) + + await lyric.update_priority( + lyric.locations[0], + lyric.devices[0], + "FollowMe", + ) + + await lyric.update_priority( + lyric.locations[0], + lyric.devices[0], + "WholeHouse", + )