Matter Thermostat: Set supportedThermostatOperatingStates if applicable#2723
Matter Thermostat: Set supportedThermostatOperatingStates if applicable#2723hcarter-775 merged 2 commits intomainfrom
Conversation
|
Channel deleted. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 3b325e9 |
d6c5e1b to
fb4330e
Compare
| device:subscribe() | ||
| device:set_component_to_endpoint_fn(thermostat_utils.component_to_endpoint) | ||
| device:set_endpoint_to_component_fn(thermostat_utils.endpoint_to_component) | ||
| thermostat_utils.handle_thermostat_operating_state_info(device) |
There was a problem hiding this comment.
I think that this running in init could falsely cause an offline device to be marked online since it emits a capability. doConfigure might be a better spot for this call (infoChanged as well in case to update the capability if the profile changes)?
Edit: thinking about it again, I'm not sure if this is true for a driver-scoped lifecycle event.
There was a problem hiding this comment.
I did add it to info_changed. I also put it in init because I want already existing devices to be udpated. Finally, I believe the {visibility = {displayed = false}} option should fix the issue you're describing? Or am I misremembering what that does?
There was a problem hiding this comment.
Edit 2: I confirmed that this does indeed cause offline devices to be marked online
There was a problem hiding this comment.
I edited the conditional to only set this if it has not been set before. Effectively, that will only do the setting once, on startup. Else, it will do this once for existing devices (and may make offline devices appear online in-app, once)
Description of Change
Set the
supportedThermostatOperatingStates, if applicable, based on the feature map of the device.Summary of Completed Tests
Unit tests updated.