Expose locked attribute in deCONZ climate platform (#46814)
This commit is contained in:
parent
b2b476596b
commit
75b37b4c2a
3 changed files with 7 additions and 2 deletions
|
@ -26,7 +26,7 @@ from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
|
|||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .const import ATTR_OFFSET, ATTR_VALVE, NEW_SENSOR
|
||||
from .const import ATTR_LOCKED, ATTR_OFFSET, ATTR_VALVE, NEW_SENSOR
|
||||
from .deconz_device import DeconzDevice
|
||||
from .gateway import get_gateway_from_config_entry
|
||||
|
||||
|
@ -254,4 +254,7 @@ class DeconzThermostat(DeconzDevice, ClimateEntity):
|
|||
if self._device.valve is not None:
|
||||
attr[ATTR_VALVE] = self._device.valve
|
||||
|
||||
if self._device.locked is not None:
|
||||
attr[ATTR_LOCKED] = self._device.locked
|
||||
|
||||
return attr
|
||||
|
|
|
@ -46,6 +46,7 @@ NEW_SCENE = "scenes"
|
|||
NEW_SENSOR = "sensors"
|
||||
|
||||
ATTR_DARK = "dark"
|
||||
ATTR_LOCKED = "locked"
|
||||
ATTR_OFFSET = "offset"
|
||||
ATTR_ON = "on"
|
||||
ATTR_VALVE = "valve"
|
||||
|
|
|
@ -92,7 +92,7 @@ async def test_simple_climate_device(hass, aioclient_mock):
|
|||
"battery": 59,
|
||||
"displayflipped": None,
|
||||
"heatsetpoint": 2100,
|
||||
"locked": None,
|
||||
"locked": True,
|
||||
"mountingmode": None,
|
||||
"offset": 0,
|
||||
"on": True,
|
||||
|
@ -132,6 +132,7 @@ async def test_simple_climate_device(hass, aioclient_mock):
|
|||
]
|
||||
assert climate_thermostat.attributes["current_temperature"] == 21.0
|
||||
assert climate_thermostat.attributes["temperature"] == 21.0
|
||||
assert climate_thermostat.attributes["locked"] is True
|
||||
assert hass.states.get("sensor.thermostat_battery_level").state == "59"
|
||||
|
||||
# Event signals thermostat configured off
|
||||
|
|
Loading…
Add table
Reference in a new issue