[update] support get device by mac_address_str
This commit is contained in:
@@ -575,6 +575,11 @@ class DeviceManager(MasterDevice, Synchronized):
|
||||
if slave.device_id == device:
|
||||
return slave
|
||||
|
||||
elif isinstance(device, str):
|
||||
for slave in self._device:
|
||||
if ':'.join(format(b, 'x') for b in slave.mac_address) == device:
|
||||
return slave
|
||||
|
||||
elif isinstance(device, DeviceInfo):
|
||||
for slave in self._device:
|
||||
if device.match(slave):
|
||||
|
||||
Reference in New Issue
Block a user