mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-14 09:02:08 +08:00
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:
@@ -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)
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user