Add number platform support to Alexa (#86553)

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
This commit is contained in:
Jan Bouwhuis 2023-01-25 13:34:53 +01:00 committed by GitHub
parent 23c9580a4a
commit f182e314e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 216 additions and 37 deletions

View file

@ -23,6 +23,7 @@ from homeassistant.components import (
light,
lock,
media_player,
number,
scene,
script,
sensor,
@ -853,8 +854,9 @@ class ImageProcessingCapabilities(AlexaEntity):
@ENTITY_ADAPTERS.register(input_number.DOMAIN)
@ENTITY_ADAPTERS.register(number.DOMAIN)
class InputNumberCapabilities(AlexaEntity):
"""Class to represent input_number capabilities."""
"""Class to represent number and input_number capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
@ -862,10 +864,8 @@ class InputNumberCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaRangeController(
self.entity, instance=f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}"
)
domain = self.entity.domain
yield AlexaRangeController(self.entity, instance=f"{domain}.value")
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)