Make gardena closing sensor unavailable when closed (#98133)
parent
a0ac8ba5a6
commit
990ec1d445
|
@ -117,3 +117,8 @@ class GardenaBluetoothRemainSensor(GardenaBluetoothEntity, SensorEntity):
|
|||
self._attr_native_value = time
|
||||
super()._handle_coordinator_update()
|
||||
return
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Sensor only available when open."""
|
||||
return super().available and self._attr_native_value is not None
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
'entity_id': 'sensor.mock_title_valve_closing',
|
||||
'last_changed': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_setup[98bd2a19-0b0e-421a-84e5-ddbf75dc6de4-raw0-sensor.mock_title_battery]
|
||||
|
|
Loading…
Reference in New Issue