mirror of
https://github.com/mjg59/python-broadlink.git
synced 2024-11-21 14:43:30 +01:00
Add a method to update device name and lock status (#537)
This commit is contained in:
parent
5dee06c815
commit
20b9eed6bc
@ -18,6 +18,12 @@ class rmmini(device):
|
||||
payload = self.decrypt(resp[0x38:])
|
||||
return payload[0x4:]
|
||||
|
||||
def update(self) -> None:
|
||||
"""Update device name and lock status."""
|
||||
resp = self._send(0x1)
|
||||
self.name = resp[0x48:].split(b"\x00")[0].decode()
|
||||
self.is_locked = bool(resp[0x87])
|
||||
|
||||
def send_data(self, data: bytes) -> None:
|
||||
"""Send a code to the device."""
|
||||
self._send(0x2, data)
|
||||
|
Loading…
Reference in New Issue
Block a user