Skip to content

Commit

Permalink
Add hardware version property
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmeu committed Feb 7, 2022
1 parent a9c3fa7 commit 7cb6f2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aionanoleaf/nanoleaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ def firmware_version(self) -> str:
"""Return the firmware version."""
return self._firmware_version

@property
def hardware_version(self) -> str | None:
"""Return the hardware version."""
return self._hardware_version

@property
def model(self) -> str:
"""Return the model."""
Expand Down Expand Up @@ -269,6 +274,7 @@ async def get_info(self) -> None:
self._serial_no = data["serialNo"]
self._manufacturer = data["manufacturer"]
self._firmware_version = data["firmwareVersion"]
self._hardware_version = data.get("hardwareVersion")
self._model = data["model"]
self._is_on = data["state"]["on"]["value"]
self._brightness = data["state"]["brightness"]["value"]
Expand Down
1 change: 1 addition & 0 deletions aionanoleaf/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class InfoData(TypedDict):
serialNo: str
manufacturer: str
firmwareVersion: str
hardwareVersion: str | None
model: str
state: StateData
effects: EffectsData
Expand Down

0 comments on commit 7cb6f2f

Please sign in to comment.