mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-15 14:48:43 +00:00
Better firmware module support for devices not connected to the internet (#854)
Devices not connected to the internet will either error when querying firmware queries (e.g. P300) or return misleading information (e.g. P100). This PR adds the cloud connect query to the initial queries and bypasses the firmware module if not connected.
This commit is contained in:
@@ -65,7 +65,6 @@ class FakeSmartTransport(BaseTransport):
|
||||
},
|
||||
},
|
||||
),
|
||||
"get_connect_cloud_state": ("cloud_connect", {"status": 1}),
|
||||
"get_on_off_gradually_info": ("on_off_gradually", {"enable": True}),
|
||||
"get_latest_fw": (
|
||||
"firmware",
|
||||
@@ -172,7 +171,7 @@ class FakeSmartTransport(BaseTransport):
|
||||
# calling the unsupported device in the first place.
|
||||
retval = {
|
||||
"error_code": SmartErrorCode.PARAMS_ERROR.value,
|
||||
"method": "get_device_usage",
|
||||
"method": method,
|
||||
}
|
||||
# Reduce warning spam by consolidating and reporting at the end of the run
|
||||
if self.fixture_name not in pytest.fixtures_missing_methods:
|
||||
|
||||
Reference in New Issue
Block a user