Skip to content

Commit

Permalink
Merge pull request #33 from peribeir/dev
Browse files Browse the repository at this point in the history
Add FW AutoUpdate and DownloadProgress
  • Loading branch information
peribeir authored Jun 8, 2023
2 parents 7b8d6c1 + b3dcb53 commit dfad57a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion homepilot/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class HomePilotHub(HomePilotDevice):
_duofern_stick_version: str
_fw_update_available: bool
_fw_update_version: str
_download_progress: int | bool
_auto_update: bool
_release_notes: str
_led_status: bool

Expand Down Expand Up @@ -105,9 +107,19 @@ async def update_state(self, state, api):
)
self.release_notes = (
state["status"]["release_notes"]
if "new_version" in state["status"] and self.fw_update_available
if "release_notes" in state["status"] and self.fw_update_available
else ""
)
self.download_progress = (
state["status"]["download_progress"]
if "download_progress" in state["status"]
else False
)
self.auto_update = (
state["status"]["auto_update"]
if "auto_update" in state["status"]
else False
)
self.led_status = state["led"]["status"] == "enabled"

async def async_ping(self):
Expand Down Expand Up @@ -162,6 +174,22 @@ def release_notes(self):
def release_notes(self, release_notes):
self._release_notes = release_notes

@property
def download_progress(self):
return self._download_progress

@download_progress.setter
def download_progress(self, download_progress):
self._download_progress = download_progress

@property
def auto_update(self):
return self._auto_update

@auto_update.setter
def auto_update(self, auto_update):
self._auto_update = auto_update

@property
def fw_update_version(self):
return self._fw_update_version
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyrademacher",
version="0.9.8",
version="0.9.9",
author="Pedro Ribeiro",
author_email="pedroeusebio@gmail.com",
description="Control devices connected to your Rademacher Homepilot "
Expand Down

0 comments on commit dfad57a

Please sign in to comment.