-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for room sensor accessories assigned to a Honeywell (Lyric) Thermostat #104343
Add support for room sensor accessories assigned to a Honeywell (Lyric) Thermostat #104343
Conversation
- Update coordinator to refresh and grab information about room sensor accessories assigned to a thermostat - Add sensor entities for room humidity and room temperature - Add devices to the registry for each room accessory - "via_device" these entities through the assigned thermostat.
Hey there @timmo001, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
@@ -158,8 +165,43 @@ class LyricDeviceEntity(LyricEntity): | |||
def device_info(self) -> DeviceInfo: | |||
"""Return device information about this Honeywell Lyric instance.""" | |||
return DeviceInfo( | |||
identifiers={(dr.CONNECTION_NETWORK_MAC, self._mac_id)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the mac address added as an identifier, is it to make via_device
work for the sub devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
location: LyricLocation, | ||
device: LyricDevice, | ||
room: LyricRoom, | ||
accessory: LyricAccessories, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class name suggests plural, but the variable name suggests singular. Which one is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its singular. Looks like its misnamed in the aiolyric library that his object comes from.
) | ||
|
||
|
||
class LyricAccessoryEntity(LyricDeviceEntity): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question that I have, currently an Accessory is bound to a room. Are there more types of accessories? Are all accessories bound to a room?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of any other thermostat accessories for this device, but they all appear to have the same data structure from the Lyric API. The only values I have observed for accessories are Thermostat
(which is a duplicate of the parent thermostat) and IndoorAirSensor
, and looking at their product pages I can only find the one model of air sensor and no other accessories. IndoorAirSensor
is the only value they use from within their API reference as well.
Air sensors must assigned a "room" from the Honeywell app in order to be operable, yes.
- update docstring to reflect ownership by thermostat - fixed potential issue where a sensor would not be added if its temperature value was 0
Good Morning (or whatever greeting appropriate for your time zone) @emontnemery and @joostlek , I have made and tested the requested code changes, and answered the questions you posed. I have re-marked the PR for review. Please don't hesitate to ask followup questions or recommend further changes. Appreciate all your help on this. |
for location in lyric.locations: | ||
for device in location.devices: | ||
if device.deviceClass == "Thermostat": | ||
await lyric.get_thermostat_rooms( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be more performant to await all promises altogether?
https://docs.python.org/3/library/asyncio-task.html#asyncio.gather
@dalinicus nice! Any possibility you can grab the motion as a binary_sensor as well??? Pwwease 🙏 |
Yup! Have it mostly coded but requires the addition of the binary_sensor platform which is new to this integration. As soon as this one is approved and merged, I'll add that in a second pull request shortly after |
Sweet deal. I will be looking out for it! |
@emontnemery and @joostlek, figured I'd check in with y'all since its been a month. Any additional feedback on this change? I'd be looking to make additional changes to add motion sensor support once this base functionally has been merged. Hope you're both having a happy holidays. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Wait was this now ready for review or not |
I believe it was ready 👍 |
Looks like there was some merge conflicts since I last worked on this. I've synced up with dev, resolved the conflicts, and re-tested. Working locally. Everything should be good for a review 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a minor comment.
for location in lyric.locations: | ||
for device in location.devices: | ||
if device.deviceClass == "Thermostat": | ||
await lyric.get_thermostat_rooms( | ||
location.locationID, device.deviceID | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @t3hk0d3, please use asyncio.gather instead, something like:
for location in lyric.locations: | |
for device in location.devices: | |
if device.deviceClass == "Thermostat": | |
await lyric.get_thermostat_rooms( | |
location.locationID, device.deviceID | |
) | |
asyncio.gather( | |
lyric.get_thermostat_rooms( | |
location.locationID, device.deviceID | |
) | |
for device in location.devices | |
for location in lyric.locations | |
if device.deviceClass == "Thermostat" | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated per suggestion; thanks for the code snippet. Re-tested locally and it continues to work as expected.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @dalinicus 👍
Breaking change
Proposed change
For the Lyric integration, adds additional sensors for room sensor accessories assigned to a thermostat. Each room sensor accessory will have a device created for it, sensors created for temperature and humidity, and
via_device
assigned to the respective thermostat.Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: