Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Commit

Permalink
bump to 0.40.2
Browse files Browse the repository at this point in the history
  • Loading branch information
doudz committed Jul 15, 2020
2 parents 947019f + 3f38495 commit 384f72b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/test_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def test_xiaomi_struct(self):
self.assertEqual(data[101], 3937) # humidity
self.assertEqual(data[102], 98981) # pressure
self.assertEqual(data[6], '0100000000') # binary data

rawdata = b'01219f0b03281e0421a81305219d0006240100000000082105140a21ed7721'
data = clusters.decode_xiaomi(rawdata)

# lumi magnet sensor
rawdata = b'0121030c0328100421a81305211f00062401000000000a210000'
Expand Down
2 changes: 1 addition & 1 deletion zigate/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def decode_xiaomi(rawdata):
rawdata = unhexlify(rawdata)
data = {}
i = 0
while i < len(rawdata):
while i < len(rawdata) - 1:
index = rawdata[i]
_type = rawdata[i + 1]
byteLength = (_type & 0x7) + 1
Expand Down
2 changes: 1 addition & 1 deletion zigate/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#


__version__ = '0.40.1'
__version__ = '0.40.2'

0 comments on commit 384f72b

Please sign in to comment.