mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Expose locked attribute in deCONZ climate platform (#46814)
This commit is contained in:
parent
b2b476596b
commit
75b37b4c2a
@ -26,7 +26,7 @@ from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS
|
|||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
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 .deconz_device import DeconzDevice
|
||||||
from .gateway import get_gateway_from_config_entry
|
from .gateway import get_gateway_from_config_entry
|
||||||
|
|
||||||
@ -254,4 +254,7 @@ class DeconzThermostat(DeconzDevice, ClimateEntity):
|
|||||||
if self._device.valve is not None:
|
if self._device.valve is not None:
|
||||||
attr[ATTR_VALVE] = self._device.valve
|
attr[ATTR_VALVE] = self._device.valve
|
||||||
|
|
||||||
|
if self._device.locked is not None:
|
||||||
|
attr[ATTR_LOCKED] = self._device.locked
|
||||||
|
|
||||||
return attr
|
return attr
|
||||||
|
@ -46,6 +46,7 @@ NEW_SCENE = "scenes"
|
|||||||
NEW_SENSOR = "sensors"
|
NEW_SENSOR = "sensors"
|
||||||
|
|
||||||
ATTR_DARK = "dark"
|
ATTR_DARK = "dark"
|
||||||
|
ATTR_LOCKED = "locked"
|
||||||
ATTR_OFFSET = "offset"
|
ATTR_OFFSET = "offset"
|
||||||
ATTR_ON = "on"
|
ATTR_ON = "on"
|
||||||
ATTR_VALVE = "valve"
|
ATTR_VALVE = "valve"
|
||||||
|
@ -92,7 +92,7 @@ async def test_simple_climate_device(hass, aioclient_mock):
|
|||||||
"battery": 59,
|
"battery": 59,
|
||||||
"displayflipped": None,
|
"displayflipped": None,
|
||||||
"heatsetpoint": 2100,
|
"heatsetpoint": 2100,
|
||||||
"locked": None,
|
"locked": True,
|
||||||
"mountingmode": None,
|
"mountingmode": None,
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
"on": True,
|
"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["current_temperature"] == 21.0
|
||||||
assert climate_thermostat.attributes["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"
|
assert hass.states.get("sensor.thermostat_battery_level").state == "59"
|
||||||
|
|
||||||
# Event signals thermostat configured off
|
# Event signals thermostat configured off
|
||||||
|
Loading…
x
Reference in New Issue
Block a user