Skip to content

Commit

Permalink
Provide the mac address as property of the device info. (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Mar 9, 2018
1 parent 2bd059c commit 0aa7af6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions miio/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def hardware_version(self) -> Optional[str]:
return self.data["hw_ver"]
return None

def mac_address(self) -> Optional[str]:
"""MAC address if available."""
if self.data["mac"] is not None:
return self.data["mac"]
return None

@property
def raw(self):
"""Raw data as returned by the device."""
Expand Down

0 comments on commit 0aa7af6

Please sign in to comment.