diff --git a/custom_components/eight_sleep/manifest.json b/custom_components/eight_sleep/manifest.json index 02d6651..c0c5a66 100644 --- a/custom_components/eight_sleep/manifest.json +++ b/custom_components/eight_sleep/manifest.json @@ -9,6 +9,6 @@ "issue_tracker": "https://github.com/lukas-clarke/eight_sleep/issues", "loggers": ["pyEight"], "requirements": ["httpx", "aiohttp"], - "version": "1.0.11" + "version": "1.0.12" } \ No newline at end of file diff --git a/custom_components/eight_sleep/sensor.py b/custom_components/eight_sleep/sensor.py index e9f04e3..ffc4ca9 100644 --- a/custom_components/eight_sleep/sensor.py +++ b/custom_components/eight_sleep/sensor.py @@ -281,15 +281,17 @@ def __init__( self._attr_native_unit_of_measurement = NAME_MAP[self._sensor].measurement self._attr_state_class = NAME_MAP[self._sensor].device_class self._attr_device_class = NAME_MAP[self._sensor].state_class - elif ( + + if self._sensor != "sleep_stage" and self._sensor != "bed_state_type": + self._attr_state_class = SensorStateClass.MEASUREMENT + + if ( self._sensor == "next_alarm" or self._sensor == "presence_start" or self._sensor == "presence_end" ): - self._attr_state_class = SensorDeviceClass.TIMESTAMP - - if self._sensor != "sleep_stage" and self._sensor != "bed_state_type": - self._attr_state_class = SensorStateClass.MEASUREMENT + self._attr_device_class = SensorDeviceClass.TIMESTAMP + self._attr_state_class = None _LOGGER.debug( "User Sensor: %s, Side: %s, User: %s",