diff --git a/custom_components/plant/sensor.py b/custom_components/plant/sensor.py index 735ab5d7..9997842d 100644 --- a/custom_components/plant/sensor.py +++ b/custom_components/plant/sensor.py @@ -211,7 +211,7 @@ async def async_added_to_hass(self) -> None: state = await self.async_get_last_state() # We do not restore the state for these they are read from the external sensor anyway - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None if state: if "external_sensor" in state.attributes: self.replace_external_sensor(state.attributes["external_sensor"]) @@ -450,9 +450,9 @@ async def async_update(self) -> None: if external_sensor: self._attr_native_value = self.ppfd(external_sensor.state) else: - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None else: - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None @callback def state_changed(self, entity_id: str, new_state: str) -> None: @@ -466,9 +466,9 @@ def state_changed(self, entity_id: str, new_state: str) -> None: if external_sensor: self._attr_native_value = self.ppfd(external_sensor.state) else: - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None else: - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None class PlantTotalLightIntegral(IntegrationSensor):