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:
Steven B
2024-04-23 12:56:32 +01:00
committed by GitHub
parent 03a0ef3cc3
commit aa969ef020
5 changed files with 89 additions and 10 deletions

View File

@@ -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: