Improve Alexa interface selection for binary sensors (#29120)
* Improve Alexa interface selection for binary sensors This allows the sensor to work correctly as a contact or motion sensor in alexa, if the user overrides its display category as such. * add tests
This commit is contained in:
parent
9160d43a08
commit
9811d63d78
3 changed files with 67 additions and 1 deletions
|
@ -543,6 +543,10 @@ class BinarySensorCapabilities(AlexaEntity):
|
|||
if CONF_DISPLAY_CATEGORIES in entity_conf:
|
||||
if entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.DOORBELL:
|
||||
yield AlexaDoorbellEventSource(self.entity)
|
||||
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.CONTACT_SENSOR:
|
||||
yield AlexaContactSensor(self.hass, self.entity)
|
||||
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.MOTION_SENSOR:
|
||||
yield AlexaMotionSensor(self.hass, self.entity)
|
||||
|
||||
yield AlexaEndpointHealth(self.hass, self.entity)
|
||||
yield Alexa(self.hass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue