Update Sunnylink dongle ID handling

The Sunnylink dongle ID is now being formatted directly in the manager.py file, reducing redundancy. Also, the check for sunnylink_dongle_id in sunnylink.py was removed to simplify the SunnlinkEnabled conditional.
This commit is contained in:
DevTekVE
2024-06-16 20:51:06 +02:00
parent 5d440cf62a
commit 65edbe4f47
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -23,8 +23,7 @@ class SunnylinkApi(BaseApi):
self.params = Params()
def api_get(self, endpoint, method='GET', timeout=10, access_token=None, **kwargs):
sunnylink_dongle_id, comma_dongle_id = self._resolve_dongle_ids()
if not self.params.get_bool("SunnylinkEnabled") or sunnylink_dongle_id in (None, UNREGISTERED_SUNNYLINK_DONGLE_ID):
if not self.params.get_bool("SunnylinkEnabled"):
return None
return super().api_get(endpoint, method, timeout, access_token, **kwargs)
+1 -1
View File
@@ -107,7 +107,7 @@ def manager_init() -> None:
("OSMDownloadProgress", "{}"),
("SidebarTemperatureOptions", "0"),
("SunnylinkEnabled", "1"),
{"SunnylinkDongleId", UNREGISTERED_SUNNYLINK_DONGLE_ID},
{"SunnylinkDongleId", f"{UNREGISTERED_SUNNYLINK_DONGLE_ID}"},
("CustomDrivingModel", "0"),
("DrivingModelGeneration", "4"),
("LastSunnylinkPingTime", "0"),