We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92a5dc8 commit d467bd7Copy full SHA for d467bd7
custom_components/ocpp/sensor.py
@@ -174,15 +174,15 @@ def native_value(self):
174
value = self.central_system.get_metric(self.cp_id, self.metric)
175
if isinstance(value, float):
176
value = round(value, self.entity_description.scale)
177
- if value:
+ if value is not None:
178
self._attr_native_value = value
179
return self._attr_native_value
180
181
@property
182
def native_unit_of_measurement(self):
183
"""Return the native unit of measurement."""
184
value = self.central_system.get_ha_unit(self.cp_id, self.metric)
185
186
self._attr_native_unit_of_measurement = value
187
return self._attr_native_unit_of_measurement
188
0 commit comments