diff --git a/homeassistant/components/lightwave/climate.py b/homeassistant/components/lightwave/climate.py index 0518e91dda9..44b1e29ff34 100644 --- a/homeassistant/components/lightwave/climate.py +++ b/homeassistant/components/lightwave/climate.py @@ -42,6 +42,7 @@ class LightwaveTrv(ClimateEntity): self._hvac_action = None self._lwlink = lwlink self._serial = serial + self._attr_unique_id = f"{serial}-trv" # inhibit is used to prevent race condition on update. If non zero, skip next update cycle. self._inhibit = 0 diff --git a/homeassistant/components/lightwave/sensor.py b/homeassistant/components/lightwave/sensor.py index f1b6412ab6a..b298b78c7f6 100644 --- a/homeassistant/components/lightwave/sensor.py +++ b/homeassistant/components/lightwave/sensor.py @@ -1,5 +1,5 @@ """Support for LightwaveRF TRV - Associated Battery.""" -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity from homeassistant.const import CONF_NAME, DEVICE_CLASS_BATTERY, PERCENTAGE from . import CONF_SERIAL, LIGHTWAVE_LINK @@ -27,6 +27,7 @@ class LightwaveBattery(SensorEntity): _attr_device_class = DEVICE_CLASS_BATTERY _attr_unit_of_measurement = PERCENTAGE + _attr_state_class = STATE_CLASS_MEASUREMENT def __init__(self, name, lwlink, serial): """Initialize the Lightwave Trv battery sensor.""" @@ -34,6 +35,7 @@ class LightwaveBattery(SensorEntity): self._state = None self._lwlink = lwlink self._serial = serial + self._attr_unique_id = f"{serial}-trv-battery" @property def name(self):