mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +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
|
entity_description: GardenaBluetoothNumberEntityDescription
|
||||||
|
|
||||||
def _handle_coordinator_update(self) -> None:
|
def _handle_coordinator_update(self) -> None:
|
||||||
if data := self.coordinator.get_cached(self.entity_description.char):
|
data = self.coordinator.get_cached(self.entity_description.char)
|
||||||
self._attr_native_value = float(data)
|
if data is None:
|
||||||
else:
|
|
||||||
self._attr_native_value = None
|
self._attr_native_value = None
|
||||||
|
else:
|
||||||
|
self._attr_native_value = float(data)
|
||||||
super()._handle_coordinator_update()
|
super()._handle_coordinator_update()
|
||||||
|
|
||||||
async def async_set_native_value(self, value: float) -> None:
|
async def async_set_native_value(self, value: float) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user