Remove model info from state (#10399)
This commit is contained in:
parent
a5aa111893
commit
50f6790a27
1 changed files with 7 additions and 8 deletions
|
@ -8,6 +8,7 @@ import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
from homeassistant.const import ATTR_BATTERY_LEVEL
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION,
|
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION,
|
||||||
SUPPORT_BRIGHTNESS, SUPPORT_TRANSITION, SUPPORT_COLOR_TEMP,
|
SUPPORT_BRIGHTNESS, SUPPORT_TRANSITION, SUPPORT_COLOR_TEMP,
|
||||||
|
@ -181,14 +182,12 @@ class TradfriLight(Light):
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the devices' state attributes."""
|
"""Return the devices' state attributes."""
|
||||||
info = self._light.device_info
|
info = self._light.device_info
|
||||||
attrs = {
|
|
||||||
'manufacturer': info.manufacturer,
|
attrs = {}
|
||||||
'model_number': info.model_number,
|
|
||||||
'serial': info.serial,
|
if info.battery_level is not None:
|
||||||
'firmware_version': info.firmware_version,
|
attrs[ATTR_BATTERY_LEVEL] = info.battery_level
|
||||||
'power_source': info.power_source_str,
|
|
||||||
'battery_level': info.battery_level
|
|
||||||
}
|
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue