Skip to content

Commit

Permalink
Temporary quick fix for signed int
Browse files Browse the repository at this point in the history
  • Loading branch information
toringer committed Nov 26, 2023
1 parent d5a3238 commit b0ba805
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/heru/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def _get_value(self):
"""Get the value from the coordinator"""
if self.idx["register_type"] == INPUT_REGISTERS:
value = self.coordinator.input_registers[self.idx["address"]]
# Temporary quick fix for signed int...
if self.idx["device_class"] == SensorDeviceClass.TEMPERATURE and value > 3200:
value = value - 65535

if self._attr_device_class == SensorDeviceClass.ENUM:
return self._attr_options[value]
return value * self.idx["scale"]
Expand Down

0 comments on commit b0ba805

Please sign in to comment.