From bb6f9ec8449f2f09aa3b766798d72eef7f0cd732 Mon Sep 17 00:00:00 2001 From: Yuxin Wang Date: Mon, 26 Aug 2024 01:09:37 -0400 Subject: [PATCH] Set native value to be None instead of STATE_UNKNOWN for APCUPSD integration (#124609) --- homeassistant/components/apcupsd/sensor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index ff72208e9ce..f2b5943bdf0 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -13,7 +13,6 @@ from homeassistant.components.sensor import ( from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( PERCENTAGE, - STATE_UNKNOWN, UnitOfApparentPower, UnitOfElectricCurrent, UnitOfElectricPotential, @@ -484,7 +483,7 @@ class APCUPSdSensor(CoordinatorEntity[APCUPSdCoordinator], SensorEntity): # performed) and may disappear again after certain event. So we mark the state as "unknown" # when it becomes unknown after such events. if key not in self.coordinator.data: - self._attr_native_value = STATE_UNKNOWN + self._attr_native_value = None return self._attr_native_value, inferred_unit = infer_unit(self.coordinator.data[key])