mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Make gardena closing sensor unavailable when closed (#98133)
This commit is contained in:
parent
a0ac8ba5a6
commit
990ec1d445
@ -117,3 +117,8 @@ class GardenaBluetoothRemainSensor(GardenaBluetoothEntity, SensorEntity):
|
|||||||
self._attr_native_value = time
|
self._attr_native_value = time
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
return
|
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',
|
'entity_id': 'sensor.mock_title_valve_closing',
|
||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
'state': 'unknown',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_setup[98bd2a19-0b0e-421a-84e5-ddbf75dc6de4-raw0-sensor.mock_title_battery]
|
# name: test_setup[98bd2a19-0b0e-421a-84e5-ddbf75dc6de4-raw0-sensor.mock_title_battery]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user