Fixed handling of zero values in TuyaNumberEntity (#60393)

This commit is contained in:
PlusPlus-ua
2021-11-26 10:35:19 +02:00
committed by GitHub
parent 3f741d4295
commit 061691508b

View File

@@ -286,7 +286,7 @@ class TuyaNumberEntity(TuyaEntity, NumberEntity):
value = self.device.status.get(self.entity_description.key)
# Scale integer/float value
if value and isinstance(self._type_data, IntegerTypeData):
if value is not None and isinstance(self._type_data, IntegerTypeData):
return self._type_data.scale_value(value)
return None