Add get_device_list add devices_sn.
This commit is contained in:
parent
b251f0c131
commit
bb96122a69
27
neohub.py
27
neohub.py
|
@ -216,3 +216,30 @@ class NeoHub:
|
||||||
|
|
||||||
result = await self._send(message)
|
result = await self._send(message)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
async def get_device_list(self, zone: str):
|
||||||
|
"""
|
||||||
|
Returns list of devices associated with zone
|
||||||
|
"""
|
||||||
|
|
||||||
|
message = {"GET_DEVICE_LIST": zone}
|
||||||
|
|
||||||
|
result = await self._send(message)
|
||||||
|
if 'error' in result:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return result[zone]
|
||||||
|
|
||||||
|
|
||||||
|
async def devices_sn(self):
|
||||||
|
"""
|
||||||
|
Returns serial numbers of attached devices
|
||||||
|
|
||||||
|
{'name': [id, 'serial', 1], ...}
|
||||||
|
"""
|
||||||
|
|
||||||
|
message = {"DEVICES_SN": 0}
|
||||||
|
|
||||||
|
result = await self._send(message)
|
||||||
|
return result
|
||||||
|
|
Loading…
Reference in New Issue