Skip to content

Commit 2a1a16d

Browse files
authored
0.6.0 Release.
2 parents 9262c17 + c5d9491 commit 2a1a16d

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
author_email="[email protected]",
1414
license="GPL-3.0",
1515
packages=find_packages(exclude=["*.tests"]),
16-
install_requires=["pyserial-asyncio", "zigpy-homeassistant >= 0.9.0"],
16+
install_requires=["pyserial-asyncio", "zigpy-homeassistant >= 0.10.0"],
1717
tests_require=["pytest"],
1818
)

tests/test_application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_rx_unknown_device(app, device):
9191
app.devices[dev.ieee] = dev
9292
app.get_device = mock.MagicMock(side_effect=[KeyError, dev])
9393
app.handle_rx(
94-
b"\x01\x02\x03\x04\x05\x06\x07\x08",
94+
b"\x08\x07\x06\x05\x04\x03\x02\x01",
9595
0x3334,
9696
mock.sentinel.src_ep,
9797
mock.sentinel.dst_ep,
@@ -300,8 +300,8 @@ async def _at_command_mock(cmd, *args):
300300
"NJ": mock.sentinel.at_nj,
301301
"OI": mock.sentinel.at_oi,
302302
"OP": mock.sentinel.at_op,
303-
"SH": 0x01020304,
304-
"SL": 0x05060708,
303+
"SH": 0x08070605,
304+
"SL": 0x04030201,
305305
"ZS": zs,
306306
}.get(cmd, None)
307307

tests/test_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ def test_deserialize():
1111
assert rest == extra
1212
assert result[0] == 0xFF
1313
assert result[1] == -2
14-
assert result[2] == t.EUI64((0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37))
14+
assert result[2] == t.EUI64((0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30))
1515

1616

1717
def test_serialize():
1818
data = [0xFF, -2, t.EUI64([t.uint8_t(i) for i in range(0x30, 0x38)])]
1919
schema = (t.uint8_t, t.int16s, t.EUI64)
2020
result = t.serialize(data, schema)
2121

22-
assert result == b"\xff\xff\xfe01234567"
22+
assert result == b"\xff\xff\xfe76543210"
2323

2424

2525
def test_bytes_serialize():

zigpy_xbee/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MAJOR_VERSION = 0
2-
MINOR_VERSION = 5
2+
MINOR_VERSION = 6
33
PATCH_VERSION = "0"
44
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
55
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION)

zigpy_xbee/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def deserialize(cls, data):
127127

128128
def serialize(self):
129129
assert self._length == len(self)
130-
return b"".join([i.serialize() for i in self])
130+
return super().serialize()[::-1]
131131

132132

133133
class UndefinedEnumMeta(enum.EnumMeta):

zigpy_xbee/zigbee/application.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from zigpy.zcl.clusters.general import Groups
1212
from zigpy.zdo.types import NodeDescriptor, ZDOCmd
1313

14-
from zigpy_xbee.types import TXStatus, UNKNOWN_IEEE, UNKNOWN_NWK
14+
from zigpy_xbee.types import EUI64, TXStatus, UNKNOWN_IEEE, UNKNOWN_NWK
1515

1616

1717
# how long coordinator would hold message for an end device in 10ms units
@@ -54,8 +54,10 @@ async def startup(self, auto_form=False):
5454

5555
serial_high = await self._api._at_command("SH")
5656
serial_low = await self._api._at_command("SL")
57-
as_bytes = serial_high.to_bytes(4, "big") + serial_low.to_bytes(4, "big")
58-
self._ieee = zigpy.types.EUI64([zigpy.types.uint8_t(b) for b in as_bytes])
57+
ieee = EUI64.deserialize(
58+
serial_high.to_bytes(4, "big") + serial_low.to_bytes(4, "big")
59+
)[0]
60+
self._ieee = zigpy.types.EUI64(ieee)
5961
LOGGER.debug("Read local IEEE address as %s", self._ieee)
6062

6163
association_state = await self._get_association_state()
@@ -277,10 +279,10 @@ async def broadcast(
277279

278280
LOGGER.debug("Broadcast request seq %s", sequence)
279281
broadcast_as_bytes = [
280-
zigpy.types.uint8_t(b) for b in broadcast_address.to_bytes(8, "big")
282+
zigpy.types.uint8_t(b) for b in broadcast_address.to_bytes(8, "little")
281283
]
282284
request = self._api.tx_explicit(
283-
zigpy.types.EUI64(broadcast_as_bytes),
285+
EUI64(broadcast_as_bytes),
284286
broadcast_address,
285287
src_ep,
286288
dst_ep,

0 commit comments

Comments
 (0)