Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added get_model function and get_fw_version to return the device model and firmware version if available #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pyintesishome/intesisbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,18 @@ def get_horizontal_swing(self, device_id) -> str:
"""Public method returns the current horizontal vane setting."""
swing = self.get_device_property(device_id, "hvane")
return swing

def get_model(self, device_id) -> str:
"""Public method returns the device model."""
if "model" in self._devices[str(device_id)]:
return self._devices[str(device_id)]["model"]
return None

def get_fw_version(self, device_id) -> str:
"""Public method returns the firmware version."""
if "fw_version" in self._devices[str(device_id)]:
return self._devices[str(device_id)]["fw_version"]
return None

def get_error(self, device_id) -> str:
"""Public method returns the current error code + description."""
Expand Down
1 change: 1 addition & 0 deletions pyintesishome/intesishomelocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ async def poll_status(self, sendcallback=False):
"name": info.get("ownSSID"),
"widgets": [],
"model": info.get("deviceModel"),
"fw_version": info.get("wlanFwVersion")
}

await self.get_datapoints()
Expand Down