Skip to content

Commit

Permalink
remove scaling (#1071)
Browse files Browse the repository at this point in the history
Co-authored-by: lbbrhzn <[email protected]>
  • Loading branch information
drc38 and lbbrhzn authored Mar 23, 2024
1 parent 0dd11db commit 4feba6b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions custom_components/ocpp/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
class OcppSensorDescription(SensorEntityDescription):
"""Class to describe a Sensor entity."""

scale: int = 1 # used for rounding metric
metric: str | None = None


Expand Down Expand Up @@ -181,8 +180,6 @@ def device_class(self):
def native_value(self):
"""Return the state of the sensor, rounding if a number."""
value = self.central_system.get_metric(self.cp_id, self.metric)
if isinstance(value, float):
value = round(value, self.entity_description.scale)
if value is not None:
self._attr_native_value = value
return self._attr_native_value
Expand Down

0 comments on commit 4feba6b

Please sign in to comment.