Cleanup default None value from dict.get (#162396)

This commit is contained in:
epenet
2026-02-06 11:49:02 +01:00
committed by GitHub
parent 2d308aaa20
commit 866cd52ada
6 changed files with 6 additions and 6 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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."""

View File

@@ -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)