From 3a32545721de29cc439a68ffd1ce8b64281833a5 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Fri, 9 Mar 2018 23:51:13 +0100 Subject: [PATCH] Provide the mac address as property of the device info. --- miio/device.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/miio/device.py b/miio/device.py index 436d46ef3..2ac4ece1d 100644 --- a/miio/device.py +++ b/miio/device.py @@ -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."""