Skip to content

Commit

Permalink
Native unit of measurement and value for sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Aug 26, 2021
1 parent 22cfbb9 commit 22aa830
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/jablotron100/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ async def async_setup_entry(hass: core.HomeAssistant, config_entry: config_entri

class JablotronSensor(JablotronEntity, SensorEntity):

_attr_unit_of_measurement = PERCENTAGE
_attr_native_unit_of_measurement = PERCENTAGE
_attr_state_class = STATE_CLASS_MEASUREMENT

def _update_attributes(self) -> None:
super()._update_attributes()

self._attr_state = self._get_state()
self._attr_native_value = self._get_state()


class JablotronSignalStrengthEntity(JablotronSensor):
Expand Down

0 comments on commit 22aa830

Please sign in to comment.