Only reflect unavailable state in DSMR when disconnected (#84862)
* Only reflect unavailable state in DSMR when disonnected * Addressreview comment
This commit is contained in:
parent
f8fa676ac8
commit
02f64ada2d
2 changed files with 31 additions and 8 deletions
|
@ -24,6 +24,7 @@ from homeassistant.const import (
|
|||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
STATE_UNAVAILABLE,
|
||||
STATE_UNKNOWN,
|
||||
VOLUME_CUBIC_METERS,
|
||||
UnitOfPower,
|
||||
)
|
||||
|
@ -783,6 +784,10 @@ async def test_reconnect(hass, dsmr_connection_fixture):
|
|||
|
||||
assert connection_factory.call_count == 1
|
||||
|
||||
state = hass.states.get("sensor.electricity_meter_power_consumption")
|
||||
assert state
|
||||
assert state.state == STATE_UNKNOWN
|
||||
|
||||
# indicate disconnect, release wait lock and allow reconnect to happen
|
||||
closed.set()
|
||||
# wait for lock set to resolve
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue