diff --git a/custom_components/eight_sleep/manifest.json b/custom_components/eight_sleep/manifest.json index 865258b..c0e35c4 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.16" + "version": "1.0.17" } \ No newline at end of file diff --git a/custom_components/eight_sleep/sensor.py b/custom_components/eight_sleep/sensor.py index 8313e81..c655862 100644 --- a/custom_components/eight_sleep/sensor.py +++ b/custom_components/eight_sleep/sensor.py @@ -289,7 +289,11 @@ def __init__( self._attr_state_class = NAME_MAP[self._sensor].device_class self._attr_device_class = NAME_MAP[self._sensor].state_class - if self._sensor != "sleep_stage" and self._sensor != "bed_state_type": + if ( + self._sensor != "sleep_stage" + and self._sensor != "bed_state_type" + and self._sensor != "side" + ): self._attr_state_class = SensorStateClass.MEASUREMENT if ( @@ -321,6 +325,8 @@ def native_value(self) -> str | int | float | None: return self._user_obj.bed_state_type if "last" in self._sensor: return self._user_obj.last_sleep_score + if "side" == self._sensor: + return self._user_obj.side if self._sensor == "bed_temperature": return self._user_obj.current_values["bed_temp"]