Skip to content

Commit

Permalink
Merge pull request #25 from MarkGodwin/needs_update_fix
Browse files Browse the repository at this point in the history
Fallback if upgrade flags are not available
  • Loading branch information
MarkGodwin authored Aug 5, 2023
2 parents ef6f79b + 0c86951 commit 1351b8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "tplink_omada_client"
version = "1.3.0"
version = "1.3.1"
authors = [
{ name="Mark Godwin", email="author@example.com" },
]
Expand Down
4 changes: 2 additions & 2 deletions src/tplink_omada_client/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ class OmadaListDevice(OmadaDevice):
def need_upgrade(self) -> bool:
"""True, if a firmware upgrade is available for the device."""
if self._data["statusCategory"] == DeviceStatusCategory.CONNECTED:
return self._data["needUpgrade"]
return self._data.get("needUpgrade", False)
else:
return False

@property
def fw_download(self) -> bool:
"""True, if a firmware upgrade is being downloaded."""
if self._data["statusCategory"] == DeviceStatusCategory.CONNECTED:
return self._data["fwDownload"]
return self._data.get("fwDownload", False)
else:
return False

Expand Down

0 comments on commit 1351b8b

Please sign in to comment.