Bug fixes
This commit is contained in:
parent
ce5c15bcd7
commit
0a42f5cab1
@ -1,6 +1,6 @@
|
|||||||
name: "Fritz!Box Temperature Sync"
|
name: "Fritz!Box Temperature Sync"
|
||||||
description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant"
|
description: "Sync Fritz!DECT thermostat temperatures with other sensors in Home Assistant"
|
||||||
version: "0.5.1"
|
version: "0.5.2"
|
||||||
startup: "application"
|
startup: "application"
|
||||||
stage: "stable"
|
stage: "stable"
|
||||||
slug: "fritz_temp_sync"
|
slug: "fritz_temp_sync"
|
||||||
|
|||||||
@ -242,12 +242,15 @@ class FritzBox:
|
|||||||
logger.debug("No id or name given")
|
logger.debug("No id or name given")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if name is None:
|
||||||
|
name = ""
|
||||||
|
|
||||||
devices = await self.list_devices()
|
devices = await self.list_devices()
|
||||||
if devices is None:
|
if devices is None:
|
||||||
return None
|
return None
|
||||||
found_device: Optional[Device] = None
|
found_device: Optional[Device] = None
|
||||||
for candidate in devices:
|
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
|
found_device = candidate
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -280,6 +283,10 @@ class FritzBox:
|
|||||||
"oldpage": "/net/home_auto_hkr_edit.lua",
|
"oldpage": "/net/home_auto_hkr_edit.lua",
|
||||||
}
|
}
|
||||||
data.update(device.to_web_data())
|
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)
|
await self._request("POST", f"{self.url}/{self._endpoints['data']}", data)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user