Add support for input_number entities in Alexa integration (#30139)

* Add support for input_number entities

* Update homeassistant/components/alexa/capabilities.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Removed get methods to directly access required attributes dicts.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
ochlocracy
2019-12-23 09:17:37 -05:00
committed by Paulus Schoutsen
parent 7f2921b0e6
commit a2678b2aff
5 changed files with 256 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ from homeassistant.components import (
group,
image_processing,
input_boolean,
input_number,
light,
lock,
media_player,
@@ -674,3 +675,21 @@ class ImageProcessingCapabilities(AlexaEntity):
yield AlexaEventDetectionSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(input_number.DOMAIN)
class InputNumberCapabilities(AlexaEntity):
"""Class to represent input_number capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.OTHER]
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaRangeController(
self.entity, instance=f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}"
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)