jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
191 stars 46 forks source link

Changing the border between is_light and is_definitely_light. #185

Closed NotExist closed 1 year ago

NotExist commented 1 year ago

Since there's some device (for example, ZB4003/43078 from enbrighten/Jasco) will be reported with light capability but it can be used as switch. Changing LIGHT_CAPABILITIES to capabilities which only useful for real light devices. And for the device which been reported with capability "Light" but not other light-related capabilities, they should not be considered as "definitely_light" since they can be used as switch in real world. image

jason0x43 commented 1 year ago

I would prefer to keep the current functionality. Hubitat's "Light" capability is intended to indicate that a device is a light, so it's reasonable for the integration to assume the device is a light. When that's not the case, both Home Assistant and this integration allow a switch device to be used as a light, or vice versa.

NotExist commented 1 year ago

When that's not the case, both Home Assistant and this integration allow a switch device to be used as a light, or vice versa.

Hi @jason0x43 , first of all thanks for your time checking this. I send the PR because I can't find the way to work this light entity as switch, in both (Home Assistant/this integration) way. I do know there's switch_as_x helper for switch in Home Assistant, but it's for switch entity, not available for light entity. I also had tried to configure the switch as light in the configuration flow of integration, but since is_definitely_light of the device is TRUE, therefore the device had been excluded during the "Set light as switch" step of the integration. And that's why I suggest to change the border.

May I know the correct way to get it right without such modification?

jason0x43 commented 1 year ago

Hmm... I think you're right.