mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Allow number to be zero in gardena bluetooth (#96872)
Allow number to be 0 in gardena
This commit is contained in:
parent
727a72fbaa
commit
0d69ba6797
@ -105,10 +105,11 @@ class GardenaBluetoothNumber(GardenaBluetoothDescriptorEntity, NumberEntity):
|
||||
entity_description: GardenaBluetoothNumberEntityDescription
|
||||
|
||||
def _handle_coordinator_update(self) -> None:
|
||||
if data := self.coordinator.get_cached(self.entity_description.char):
|
||||
self._attr_native_value = float(data)
|
||||
else:
|
||||
data = self.coordinator.get_cached(self.entity_description.char)
|
||||
if data is None:
|
||||
self._attr_native_value = None
|
||||
else:
|
||||
self._attr_native_value = float(data)
|
||||
super()._handle_coordinator_update()
|
||||
|
||||
async def async_set_native_value(self, value: float) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user