-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathdevice.py
More file actions
66 lines (55 loc) · 1.58 KB
/
device.py
File metadata and controls
66 lines (55 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from __future__ import annotations
import logging
import zigpy.zdo
import zigpy.types
import zigpy.device
import zigpy.application
LOGGER = logging.getLogger(__name__)
class ZNPCoordinator(zigpy.device.Device):
"""
Coordinator zigpy device that keeps track of our endpoints and clusters.
"""
@property
def manufacturer(self) -> str:
return "Texas Instruments"
@manufacturer.setter
def manufacturer(self, value: str) -> None:
# Setter for parent class interface; no-op (hardware-determined)
pass
@property
def model(self) -> str:
return "Coordinator"
@model.setter
def model(self, value: str) -> None:
# Setter for parent class interface; no-op (hardware-determined)
pass
async def request(
self,
profile,
cluster,
src_ep,
dst_ep,
sequence,
data,
expect_reply=True,
timeout=2 * zigpy.device.APS_REPLY_TIMEOUT,
use_ieee=False,
ask_for_ack: bool | None = None,
priority: int | None = zigpy.types.PacketPriority.NORMAL,
):
"""
Normal `zigpy.device.Device:request` except its default timeout is longer.
"""
return await super().request(
profile=profile,
cluster=cluster,
src_ep=src_ep,
dst_ep=dst_ep,
sequence=sequence,
data=data,
expect_reply=expect_reply,
timeout=timeout,
use_ieee=use_ieee,
ask_for_ack=ask_for_ack,
priority=priority,
)