diff --git a/.version b/.version index c3317ad..111db30 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.4.5.9 \ No newline at end of file +0.4.5.10rc1 \ No newline at end of file diff --git a/examples/cover.py b/examples/cover.py index c038301..ffbbba3 100644 --- a/examples/cover.py +++ b/examples/cover.py @@ -19,7 +19,7 @@ async def main(): # Retrieve all the devices that implement the garage-door opening mixin await manager.async_device_discovery() - openers = manager.find_devices(device_class=GarageOpenerMixin) + openers = manager.find_devices(device_class=GarageOpenerMixin, device_type="msg100") if len(openers) < 1: print("No garage opener found...") diff --git a/meross_iot/controller/device.py b/meross_iot/controller/device.py index 1409d95..876b7c3 100644 --- a/meross_iot/controller/device.py +++ b/meross_iot/controller/device.py @@ -29,6 +29,7 @@ class BaseDevice(object): _hwversion: str = "unknown" _online: OnlineStatus = OnlineStatus.UNKNOWN _inner_ip: Optional[str] = None + _mac_address: Optional[str] = None _mqtt_host: str = DEFAULT_MQTT_HOST _mqtt_port: int = DEFAULT_MQTT_PORT @@ -87,6 +88,10 @@ def cached_http_info(self) -> Optional[HttpDeviceInfo]: def lan_ip(self): return self._inner_ip + @property + def mac_address(self): + return self._mac_address + @property def mqtt_host(self): return self._mqtt_host @@ -240,6 +245,7 @@ async def async_handle_update(self, namespace: Namespace, data: dict) -> bool: # TODO: we might update name/uuid/other stuff in here... system = data.get('all', {}).get('system', {}) self._inner_ip = system.get('firmware', {}).get('innerIp') + self._mac_address = system.get('hardware', {}).get('macAddress', None) await self._fire_push_notification_event(namespace=namespace, data=data, device_internal_id=self.internal_id) self._last_full_update_ts = time.time() * 1000 diff --git a/utilities/meross_sniffer.py b/utilities/meross_sniffer.py index 0fdf4b7..3344bb3 100644 --- a/utilities/meross_sniffer.py +++ b/utilities/meross_sniffer.py @@ -215,7 +215,7 @@ async def _async_sniff(device_sniffer: FakeDeviceSniffer, zip_obj: ZipFile, mero messages.add(key) print(f"New message type received: {method} {namespace}: {payload}") note = input("Describe the command you issued on the APP which caused this message. If unsure, just type \"?\" or \"IDK\": ") - f.write(f"Command Description: {note}\n\n") + f.write(f"\n\nCommand Description: {note}\n\n") f.write(f"Request: \n") f.write(raw_message.payload.decode('utf8')) f.flush()