Skip to content

Commit

Permalink
Update sensor for temperature unit of measure.
Browse files Browse the repository at this point in the history
  • Loading branch information
djtimca committed May 31, 2022
1 parent 81a5a69 commit 5ead751
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion custom_components/omnilogic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,19 @@ def state(self):
@property
def native_value(self):
"""Return the native temperature returned."""
return self.coordinator.data[self._item_id][self._state_key]
sensor_data = self.coordinator.data[self._item_id][self._state_key]
if int(sensor_data) == -1:
return None

return sensor_data

@property
def native_unit_of_measurement(self):
"""Return the native unit of measure."""
if self._unit_type == "Metric":
return TEMP_CELSIUS

return TEMP_FAHRENHEIT


class OmniLogicPumpSpeedSensor(OmnilogicSensor):
Expand Down

0 comments on commit 5ead751

Please sign in to comment.