Skip to content

Commit 2e56fc8

Browse files
committed
Rework for mypy
1 parent b083ace commit 2e56fc8

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

airos/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,16 @@ async def login(self) -> None:
383383
else:
384384
return
385385

386-
async def status(self, underived: bool = False) -> AirOSDataModel | dict[str, Any]:
386+
async def raw_status(self) -> dict[str, Any]:
387+
"""Retrieve raw status from the device."""
388+
return await self._request_json("GET", self._status_cgi_url, authenticated=True)
389+
390+
async def status(self) -> AirOSDataModel:
387391
"""Retrieve status from the device."""
388392
response = await self._request_json(
389393
"GET", self._status_cgi_url, authenticated=True
390394
)
391395

392-
if underived:
393-
return response
394-
395396
try:
396397
adjusted_json = self.derived_data(response)
397398
return self.data_model.from_dict(adjusted_json)

airos/helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def async_get_firmware_data(
3737

3838
try:
3939
await detect_device.login()
40-
device_data = await detect_device.status(underived=True)
40+
device_data = await detect_device.raw_status()
4141
except (
4242
AirOSConnectionSetupError,
4343
AirOSDeviceConnectionError,
@@ -51,8 +51,6 @@ async def async_get_firmware_data(
5151
_LOGGER.exception("Key data missing from device at %s", host)
5252
raise
5353

54-
assert isinstance(device_data, dict)
55-
5654
return {
5755
"fw_major": AirOS8.get_fw_major(device_data.get("host", {}).get("fwversion")),
5856
"hostname": device_data.get("host", {}).get("hostname"),

0 commit comments

Comments
 (0)