diff --git a/fritz_temp_sync/config.yaml b/fritz_temp_sync/config.yaml index b39f771..8d9f48d 100755 --- a/fritz_temp_sync/config.yaml +++ b/fritz_temp_sync/config.yaml @@ -1,6 +1,6 @@ name: "Fritz!Box Temperature Sync" description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant" -version: "0.5.1" +version: "0.5.2" startup: "application" stage: "stable" slug: "fritz_temp_sync" diff --git a/fritz_temp_sync/fritzbox.py b/fritz_temp_sync/fritzbox.py index 7c6dd2b..28870eb 100755 --- a/fritz_temp_sync/fritzbox.py +++ b/fritz_temp_sync/fritzbox.py @@ -242,12 +242,15 @@ class FritzBox: logger.debug("No id or name given") return None + if name is None: + name = "" + devices = await self.list_devices() if devices is None: return None found_device: Optional[Device] = None for candidate in devices: - if candidate.id == idx or candidate.display_name == name: + if candidate.id == idx or candidate.display_name.strip() == name.strip(): found_device = candidate break @@ -280,6 +283,10 @@ class FritzBox: "oldpage": "/net/home_auto_hkr_edit.lua", } data.update(device.to_web_data()) + if "Mintemp" not in data: + data["Mintemp"] = "16" + if "Maxtemp" not in data: + data["Maxtemp"] = "23" await self._request("POST", f"{self.url}/{self._endpoints['data']}", data)