|
1 | 1 | import asyncio
|
2 | 2 | import binascii
|
3 | 3 | import logging
|
| 4 | +import time |
4 | 5 |
|
5 | 6 | import zigpy.application
|
6 |
| -import zigpy.exceptions |
7 | 7 | import zigpy.device
|
| 8 | +import zigpy.exceptions |
8 | 9 | import zigpy.quirks
|
9 | 10 | import zigpy.types
|
10 | 11 | import zigpy.util
|
11 | 12 | from zigpy.zcl.clusters.general import Groups
|
12 | 13 | from zigpy.zdo.types import NodeDescriptor, ZDOCmd
|
13 | 14 |
|
14 |
| -from zigpy_xbee.types import EUI64, TXStatus, UNKNOWN_IEEE, UNKNOWN_NWK |
15 |
| - |
| 15 | +from zigpy_xbee.types import EUI64, UNKNOWN_IEEE, UNKNOWN_NWK, TXStatus |
16 | 16 |
|
17 | 17 | # how long coordinator would hold message for an end device in 10ms units
|
18 | 18 | CONF_CYCLIC_SLEEP_PERIOD = 0x0300
|
@@ -97,6 +97,7 @@ async def startup(self, auto_form=False):
|
97 | 97 | LOGGER.debug("sending CE command: %s", exc)
|
98 | 98 |
|
99 | 99 | dev = zigpy.device.Device(self, self.ieee, self.nwk)
|
| 100 | + dev.status = zigpy.device.Status.ENDPOINTS_INIT |
100 | 101 | dev.add_endpoint(XBEE_ENDPOINT_ID)
|
101 | 102 | self.listener_event("raw_device_initialized", dev)
|
102 | 103 | xbee_dev = XBeeCoordinator(self, self.ieee, self.nwk, dev)
|
@@ -283,6 +284,10 @@ def handle_rx(
|
283 | 284 | )
|
284 | 285 | self.handle_join(nwk, ieee, 0)
|
285 | 286 |
|
| 287 | + try: |
| 288 | + self.devices[self.ieee].last_seen = time.time() |
| 289 | + except KeyError: |
| 290 | + pass |
286 | 291 | try:
|
287 | 292 | device = self.get_device(nwk=src_nwk)
|
288 | 293 | except KeyError:
|
|
0 commit comments