From a406068f13022c7279ccf7c68c4553df60896124 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:32:46 +0200 Subject: [PATCH] Fix implicit-return in homematic (#122922) --- homeassistant/components/homematic/__init__.py | 3 +++ homeassistant/components/homematic/climate.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/homeassistant/components/homematic/__init__.py b/homeassistant/components/homematic/__init__.py index 80345866b1f..f0fc2a40278 100644 --- a/homeassistant/components/homematic/__init__.py +++ b/homeassistant/components/homematic/__init__.py @@ -573,6 +573,8 @@ def _create_ha_id(name, channel, param, count): if count > 1 and param is not None: return f"{name} {channel} {param}" + raise ValueError(f"Unable to create unique id for count:{count} and param:{param}") + def _hm_event_handler(hass, interface, device, caller, attribute, value): """Handle all pyhomematic device events.""" @@ -621,3 +623,4 @@ def _device_from_servicecall(hass, service): for devices in hass.data[DATA_HOMEMATIC].devices.values(): if address in devices: return devices[address] + return None diff --git a/homeassistant/components/homematic/climate.py b/homeassistant/components/homematic/climate.py index bf1295df6be..2be28487cbb 100644 --- a/homeassistant/components/homematic/climate.py +++ b/homeassistant/components/homematic/climate.py @@ -125,6 +125,7 @@ class HMThermostat(HMDevice, ClimateEntity): for node in HM_HUMI_MAP: if node in self._data: return self._data[node] + return None @property def current_temperature(self): @@ -132,6 +133,7 @@ class HMThermostat(HMDevice, ClimateEntity): for node in HM_TEMP_MAP: if node in self._data: return self._data[node] + return None @property def target_temperature(self):