Add tradfri cover model to the cover entity attributes (#33674)

* Ikea Blind Battery

* Ikea Blind Battery

* Ikea Blind Battery

* Ikea Blind Battery

* IKEA Blinds Battery

* IKEA Blinds Battery

* Update cover.py

* Clean up

* Remove unused import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Kris Bennett 2020-04-10 03:37:55 +10:00 committed by GitHub
parent c651ce06c5
commit f2fbe657c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,7 @@ ATTR_TRADFRI_GATEWAY = "Gateway"
ATTR_TRADFRI_GATEWAY_MODEL = "E1526"
ATTR_TRADFRI_MANUFACTURER = "IKEA of Sweden"
ATTR_TRANSITION_TIME = "transition_time"
ATTR_MODEL = "model"
CONF_ALLOW_TRADFRI_GROUPS = "allow_tradfri_groups"
CONF_IDENTITY = "identity"
CONF_IMPORT_GROUPS = "import_groups"

View File

@ -3,7 +3,7 @@
from homeassistant.components.cover import ATTR_POSITION, CoverDevice
from .base_class import TradfriBaseDevice
from .const import CONF_GATEWAY_ID, KEY_API, KEY_GATEWAY
from .const import ATTR_MODEL, CONF_GATEWAY_ID, KEY_API, KEY_GATEWAY
async def async_setup_entry(hass, config_entry, async_add_entities):
@ -29,6 +29,12 @@ class TradfriCover(TradfriBaseDevice, CoverDevice):
self._refresh(device)
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {ATTR_MODEL: self._device.device_info.model_number}
return attr
@property
def current_cover_position(self):
"""Return current position of cover.