From 866cd52ada29eba3beff31995084aaa076312442 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 6 Feb 2026 11:49:02 +0100 Subject: [PATCH] Cleanup default None value from dict.get (#162396) --- homeassistant/components/arwn/sensor.py | 2 +- homeassistant/components/egardia/binary_sensor.py | 2 +- homeassistant/components/lyric/climate.py | 2 +- homeassistant/components/onvif/parsers.py | 2 +- homeassistant/components/vicare/climate.py | 2 +- homeassistant/components/vicare/water_heater.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/arwn/sensor.py b/homeassistant/components/arwn/sensor.py index 4cc4feed2d4..bd8be66d9ba 100644 --- a/homeassistant/components/arwn/sensor.py +++ b/homeassistant/components/arwn/sensor.py @@ -201,5 +201,5 @@ class ArwnSensor(SensorEntity): ev: dict[str, Any] = {} ev.update(event) self._attr_extra_state_attributes = ev - self._attr_native_value = ev.get(self._state_key, None) + self._attr_native_value = ev.get(self._state_key) self.async_write_ha_state() diff --git a/homeassistant/components/egardia/binary_sensor.py b/homeassistant/components/egardia/binary_sensor.py index 9c778cdad5a..3b3e68f51f9 100644 --- a/homeassistant/components/egardia/binary_sensor.py +++ b/homeassistant/components/egardia/binary_sensor.py @@ -40,7 +40,7 @@ async def async_setup_platform( name=disc_info[sensor]["name"], egardia_system=hass.data[EGARDIA_DEVICE], device_class=EGARDIA_TYPE_TO_DEVICE_CLASS.get( - disc_info[sensor]["type"], None + disc_info[sensor]["type"] ), ) for sensor in disc_info diff --git a/homeassistant/components/lyric/climate.py b/homeassistant/components/lyric/climate.py index e71c81774af..65bf03416d1 100644 --- a/homeassistant/components/lyric/climate.py +++ b/homeassistant/components/lyric/climate.py @@ -254,7 +254,7 @@ class LyricClimate(LyricDeviceEntity, ClimateEntity): @property def hvac_action(self) -> HVACAction | None: """Return the current hvac action.""" - action = HVAC_ACTIONS.get(self.device.operation_status.mode, None) + action = HVAC_ACTIONS.get(self.device.operation_status.mode) if action == HVACAction.OFF and self.hvac_mode != HVACMode.OFF: action = HVACAction.IDLE return action diff --git a/homeassistant/components/onvif/parsers.py b/homeassistant/components/onvif/parsers.py index e5a731c73f6..32adf696bde 100644 --- a/homeassistant/components/onvif/parsers.py +++ b/homeassistant/components/onvif/parsers.py @@ -397,7 +397,7 @@ async def async_parse_tplink_detector(uid: str, msg) -> Event | None: rule = source.Value for item in payload.Data.SimpleItem: - event_template = _TAPO_EVENT_TEMPLATES.get(item.Name, None) + event_template = _TAPO_EVENT_TEMPLATES.get(item.Name) if event_template is None: continue diff --git a/homeassistant/components/vicare/climate.py b/homeassistant/components/vicare/climate.py index deb053eebc7..d55c12087a0 100644 --- a/homeassistant/components/vicare/climate.py +++ b/homeassistant/components/vicare/climate.py @@ -228,7 +228,7 @@ class ViCareClimate(ViCareEntity, ClimateEntity): """Return current hvac mode.""" if self._current_mode is None: return None - return VICARE_TO_HA_HVAC_HEATING.get(self._current_mode, None) + return VICARE_TO_HA_HVAC_HEATING.get(self._current_mode) def set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set a new hvac mode on the ViCare API.""" diff --git a/homeassistant/components/vicare/water_heater.py b/homeassistant/components/vicare/water_heater.py index f92c9e3e1af..0e60578424f 100644 --- a/homeassistant/components/vicare/water_heater.py +++ b/homeassistant/components/vicare/water_heater.py @@ -151,4 +151,4 @@ class ViCareWater(ViCareEntity, WaterHeaterEntity): """Return current operation ie. heat, cool, idle.""" if self._current_mode is None: return None - return VICARE_TO_HA_HVAC_DHW.get(self._current_mode, None) + return VICARE_TO_HA_HVAC_DHW.get(self._current_mode)