linknlink 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: linknlink
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Python API for controlling linknlink devices
5
5
  Home-page: https://github.com/xuanxuan000/python-linknlink
6
6
  Author: Zhao Zehua
@@ -29,8 +29,10 @@ class ehub(Device):
29
29
  resp = self.send_packet(0x6A, packet)
30
30
  e.check_error(resp[0x22:0x24])
31
31
  payload = self.decrypt(resp[0x38:])
32
- p_len = struct.unpack("<H", payload[:0x2])[0]
33
- return payload[0x6 : p_len + 2]
32
+ if 20000 <= self.devtype <= 29999:
33
+ p_len = struct.unpack("<H", payload[:0x2])[0]
34
+ return payload[0x6 : p_len + 2]
35
+ return payload[0x4:]
34
36
 
35
37
  def check_sensors(self) -> dict:
36
38
  """Return the state of the sensors."""
@@ -105,8 +107,10 @@ class eremote(Device):
105
107
  resp = self.send_packet(0x6A, packet)
106
108
  e.check_error(resp[0x22:0x24])
107
109
  payload = self.decrypt(resp[0x38:])
108
- p_len = struct.unpack("<H", payload[:0x2])[0]
109
- return payload[0x6 : p_len + 2]
110
+ if 20000 <= self.devtype <= 29999:
111
+ p_len = struct.unpack("<H", payload[:0x2])[0]
112
+ return payload[0x6 : p_len + 2]
113
+ return payload[0x4:]
110
114
 
111
115
  def _sendV2(self, command: int, data: bytes = b"") -> bytes:
112
116
  """Send a packet to the device."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: linknlink
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Python API for controlling linknlink devices
5
5
  Home-page: https://github.com/xuanxuan000/python-linknlink
6
6
  Author: Zhao Zehua
@@ -5,7 +5,7 @@
5
5
  from setuptools import setup, find_packages
6
6
 
7
7
 
8
- version = '0.2.3'
8
+ version = '0.2.4'
9
9
 
10
10
  setup(
11
11
  name="linknlink",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes