pyg90alarm 2.1.0__py3-none-any.whl → 2.2.0__py3-none-any.whl
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.
- pyg90alarm/__init__.py +28 -5
- pyg90alarm/alarm.py +248 -54
- pyg90alarm/callback.py +41 -3
- pyg90alarm/cloud/messages.py +7 -7
- pyg90alarm/const.py +4 -1
- pyg90alarm/definitions/base.py +247 -0
- pyg90alarm/definitions/devices.py +366 -0
- pyg90alarm/definitions/sensors.py +812 -828
- pyg90alarm/entities/base_entity.py +10 -0
- pyg90alarm/entities/base_list.py +136 -33
- pyg90alarm/entities/device.py +23 -1
- pyg90alarm/entities/device_list.py +99 -1
- pyg90alarm/entities/sensor.py +83 -89
- pyg90alarm/entities/sensor_list.py +136 -3
- pyg90alarm/exceptions.py +24 -0
- pyg90alarm/local/base_cmd.py +34 -12
- pyg90alarm/local/notifications.py +3 -3
- pyg90alarm/notifications/base.py +29 -2
- pyg90alarm/notifications/protocol.py +11 -0
- {pyg90alarm-2.1.0.dist-info → pyg90alarm-2.2.0.dist-info}/METADATA +1 -1
- pyg90alarm-2.2.0.dist-info/RECORD +42 -0
- {pyg90alarm-2.1.0.dist-info → pyg90alarm-2.2.0.dist-info}/WHEEL +1 -1
- pyg90alarm-2.1.0.dist-info/RECORD +0 -40
- {pyg90alarm-2.1.0.dist-info → pyg90alarm-2.2.0.dist-info}/licenses/LICENSE +0 -0
- {pyg90alarm-2.1.0.dist-info → pyg90alarm-2.2.0.dist-info}/top_level.txt +0 -0
pyg90alarm/cloud/messages.py
CHANGED
|
@@ -40,7 +40,7 @@ from ..const import (
|
|
|
40
40
|
G90AlertStateChangeTypes, REMOTE_CLOUD_HOST, REMOTE_CLOUD_PORT,
|
|
41
41
|
G90AlertTypes, G90AlertSources, G90AlertStates,
|
|
42
42
|
)
|
|
43
|
-
from ..
|
|
43
|
+
from ..definitions.base import G90PeripheralTypes
|
|
44
44
|
from ..notifications.base import G90DeviceAlert
|
|
45
45
|
|
|
46
46
|
|
|
@@ -369,19 +369,19 @@ class G90CloudStatusChangeSensorReqMessage(G90CloudStatusChangeReqMessageBase):
|
|
|
369
369
|
|
|
370
370
|
type: int
|
|
371
371
|
sensor_id: int
|
|
372
|
-
_sensor_type:
|
|
372
|
+
_sensor_type: G90PeripheralTypes
|
|
373
373
|
_sensor_state: int
|
|
374
374
|
_sensor: bytes
|
|
375
375
|
_timestamp: int # Unix timestamp
|
|
376
376
|
|
|
377
377
|
@property
|
|
378
|
-
def sensor_type(self) ->
|
|
378
|
+
def sensor_type(self) -> G90PeripheralTypes:
|
|
379
379
|
"""
|
|
380
380
|
Get the sensor type.
|
|
381
381
|
|
|
382
382
|
:return: The type of the sensor that triggered the event
|
|
383
383
|
"""
|
|
384
|
-
return
|
|
384
|
+
return G90PeripheralTypes(self._sensor_type)
|
|
385
385
|
|
|
386
386
|
@property
|
|
387
387
|
def sensor_state(self) -> G90AlertStates:
|
|
@@ -453,7 +453,7 @@ class G90CloudStatusChangeAlarmReqMessage(G90CloudStatusChangeReqMessageBase):
|
|
|
453
453
|
|
|
454
454
|
type: int
|
|
455
455
|
sensor_id: int
|
|
456
|
-
_sensor_type:
|
|
456
|
+
_sensor_type: G90PeripheralTypes
|
|
457
457
|
_sensor_state: int
|
|
458
458
|
_sensor: bytes
|
|
459
459
|
_timestamp: int # Unix timestamp
|
|
@@ -478,13 +478,13 @@ class G90CloudStatusChangeAlarmReqMessage(G90CloudStatusChangeReqMessageBase):
|
|
|
478
478
|
return self._sensor.decode().rstrip('\x00')
|
|
479
479
|
|
|
480
480
|
@property
|
|
481
|
-
def sensor_type(self) ->
|
|
481
|
+
def sensor_type(self) -> G90PeripheralTypes:
|
|
482
482
|
"""
|
|
483
483
|
Get the sensor type for the alarm event.
|
|
484
484
|
|
|
485
485
|
:return: The type of sensor that triggered the alarm
|
|
486
486
|
"""
|
|
487
|
-
return
|
|
487
|
+
return G90PeripheralTypes(self._sensor_type)
|
|
488
488
|
|
|
489
489
|
@property
|
|
490
490
|
def as_device_alert(self) -> G90DeviceAlert:
|
pyg90alarm/const.py
CHANGED
|
@@ -34,6 +34,8 @@ CLOUD_NOTIFICATIONS_HOST = '0.0.0.0'
|
|
|
34
34
|
CLOUD_NOTIFICATIONS_PORT = 5678
|
|
35
35
|
REMOTE_CLOUD_HOST = '47.88.7.61'
|
|
36
36
|
REMOTE_CLOUD_PORT = 5678
|
|
37
|
+
DEVICE_REGISTRATION_TIMEOUT = 30
|
|
38
|
+
ROOM_ID = 0
|
|
37
39
|
|
|
38
40
|
CMD_PAGE_SIZE = 10
|
|
39
41
|
|
|
@@ -92,6 +94,7 @@ class G90Commands(IntEnum):
|
|
|
92
94
|
""")
|
|
93
95
|
GETSINGLEDEVICE = 139
|
|
94
96
|
SETSINGLEDEVICE = 140
|
|
97
|
+
SENDREGDEVICERESULT = 162
|
|
95
98
|
DELALLDEVICES = 203
|
|
96
99
|
# Host config
|
|
97
100
|
GETHOSTCONFIG = 106
|
|
@@ -170,7 +173,7 @@ class G90NotificationTypes(IntEnum):
|
|
|
170
173
|
Defines types of notifications sent by the alarm panel.
|
|
171
174
|
"""
|
|
172
175
|
ARM_DISARM = 1
|
|
173
|
-
|
|
176
|
+
SENSOR_CHANGE = 4
|
|
174
177
|
SENSOR_ACTIVITY = 5
|
|
175
178
|
DOOR_OPEN_WHEN_ARMING = 6
|
|
176
179
|
FIRMWARE_UPDATING = 8
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Copyright (c) 2025 Ilia Sotnikov
|
|
2
|
+
#
|
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
# furnished to do so, subject to the following conditions:
|
|
9
|
+
#
|
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
|
11
|
+
# all copies or substantial portions of the Software.
|
|
12
|
+
#
|
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
# SOFTWARE.
|
|
20
|
+
"""
|
|
21
|
+
Base entities for peripheral definitions.
|
|
22
|
+
"""
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
from dataclasses import dataclass
|
|
25
|
+
from itertools import groupby
|
|
26
|
+
from enum import IntEnum
|
|
27
|
+
from abc import ABC, abstractmethod
|
|
28
|
+
import logging
|
|
29
|
+
from ..exceptions import G90PeripheralDefinitionNotFound, G90Error
|
|
30
|
+
|
|
31
|
+
_LOGGER = logging.getLogger(__name__)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class G90PeripheralProtocols(IntEnum):
|
|
35
|
+
"""
|
|
36
|
+
Protocol types for the peripherals.
|
|
37
|
+
"""
|
|
38
|
+
RF_1527 = 0
|
|
39
|
+
RF_2262 = 1
|
|
40
|
+
RF_PRIVATE = 2
|
|
41
|
+
RF_SLIDER = 3
|
|
42
|
+
CORD = 5
|
|
43
|
+
WIFI = 4
|
|
44
|
+
USB = 6
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class G90PeripheralTypes(IntEnum):
|
|
48
|
+
"""
|
|
49
|
+
Peripheral types.
|
|
50
|
+
"""
|
|
51
|
+
DOOR = 1
|
|
52
|
+
GLASS = 2
|
|
53
|
+
GAS = 3
|
|
54
|
+
SMOKE = 4
|
|
55
|
+
SOS = 5
|
|
56
|
+
VIB = 6
|
|
57
|
+
WATER = 7
|
|
58
|
+
INFRARED = 8
|
|
59
|
+
IN_BEAM = 9
|
|
60
|
+
REMOTE = 10
|
|
61
|
+
RFID = 11
|
|
62
|
+
DOORBELL = 12
|
|
63
|
+
BUTTONID = 13
|
|
64
|
+
WATCH = 14
|
|
65
|
+
FINGER_LOCK = 15
|
|
66
|
+
SUBHOST = 16
|
|
67
|
+
REMOTE_2_4G = 17
|
|
68
|
+
GAS_VALVE = 18
|
|
69
|
+
CORD_SENSOR = 126
|
|
70
|
+
SOCKET = 128
|
|
71
|
+
SIREN = 129
|
|
72
|
+
CURTAIN = 130
|
|
73
|
+
SLIDINGWIN = 131
|
|
74
|
+
AIRCON = 133
|
|
75
|
+
TV = 135
|
|
76
|
+
TV_BOX = 136
|
|
77
|
+
SMART_SWITCH = 137
|
|
78
|
+
NIGHTLIGHT = 138
|
|
79
|
+
SOCKET_2_4G = 140
|
|
80
|
+
SIREN_2_4G = 141
|
|
81
|
+
SWITCH_2_4G = 142
|
|
82
|
+
TOUCH_SWITCH_2_4G = 143
|
|
83
|
+
CURTAIN_2_4G = 144
|
|
84
|
+
IR_2_4G = 145
|
|
85
|
+
CORD_DEV = 254
|
|
86
|
+
UNKNOWN = 255
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class G90PeripheralMatchModes(IntEnum):
|
|
90
|
+
"""
|
|
91
|
+
Defines compare (match) mode for the peripheral.
|
|
92
|
+
"""
|
|
93
|
+
ALL = 0
|
|
94
|
+
ONLY20BITS = 1
|
|
95
|
+
ONLY16BITS = 2
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class G90PeripheralRwModes(IntEnum):
|
|
99
|
+
"""
|
|
100
|
+
Defines read/write mode for the peripheral.
|
|
101
|
+
"""
|
|
102
|
+
READ = 0
|
|
103
|
+
WRITE = 1
|
|
104
|
+
READ_WRITE = 2
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@dataclass(frozen=True)
|
|
108
|
+
class G90PeripheralDefinition:
|
|
109
|
+
# pylint: disable=too-many-instance-attributes
|
|
110
|
+
"""
|
|
111
|
+
Holds peripheral definition data.
|
|
112
|
+
"""
|
|
113
|
+
type: G90PeripheralTypes
|
|
114
|
+
subtype: int
|
|
115
|
+
rx: int
|
|
116
|
+
tx: int
|
|
117
|
+
private_data: str
|
|
118
|
+
rw_mode: G90PeripheralRwModes
|
|
119
|
+
match_mode: G90PeripheralMatchModes
|
|
120
|
+
name: str
|
|
121
|
+
protocol: G90PeripheralProtocols
|
|
122
|
+
timeout: int
|
|
123
|
+
baudrate: int
|
|
124
|
+
node_count: int
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def reserved_data(self) -> int:
|
|
128
|
+
"""
|
|
129
|
+
Peripheral's 'reserved_data' field to be written, combined of match
|
|
130
|
+
and RW mode values bitwise.
|
|
131
|
+
"""
|
|
132
|
+
return self.match_mode.value << 4 | self.rw_mode.value
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def unique_definitions(
|
|
136
|
+
obj: type[G90PeripheralDefinitionsBase]
|
|
137
|
+
) -> type[G90PeripheralDefinitionsBase]:
|
|
138
|
+
"""
|
|
139
|
+
Decorator to ensure that peripheral definitions are unique by name
|
|
140
|
+
and type/subtype/protocol.
|
|
141
|
+
|
|
142
|
+
:param obj: Class to decorate.
|
|
143
|
+
:return: Decorated class with unique definitions.
|
|
144
|
+
:raises G90Error: If definitions are not unique.
|
|
145
|
+
"""
|
|
146
|
+
names = groupby(
|
|
147
|
+
sorted(obj.definitions(), key=lambda x: x.name),
|
|
148
|
+
lambda x: x.name
|
|
149
|
+
)
|
|
150
|
+
type_subtype = groupby(
|
|
151
|
+
sorted(
|
|
152
|
+
obj.definitions(),
|
|
153
|
+
key=lambda x: (x.type, x.subtype, x.protocol)
|
|
154
|
+
),
|
|
155
|
+
lambda x: (x.type, x.subtype, x.protocol)
|
|
156
|
+
)
|
|
157
|
+
non_unique_names = [
|
|
158
|
+
k for _, group in names if len(k := list(group)) > 1
|
|
159
|
+
]
|
|
160
|
+
non_unique_types = [
|
|
161
|
+
k for _, group in type_subtype if len(k := list(group)) > 1
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
msgs = []
|
|
165
|
+
if non_unique_names:
|
|
166
|
+
msgs.append(
|
|
167
|
+
f"{obj}: Peripheral definitions have non-unique names: \n"
|
|
168
|
+
f"{non_unique_names}"
|
|
169
|
+
)
|
|
170
|
+
if non_unique_types:
|
|
171
|
+
msgs.append(
|
|
172
|
+
f"{obj}: Peripheral definitions have non-unique types: \n"
|
|
173
|
+
f"{non_unique_types}"
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
if msgs:
|
|
177
|
+
raise G90Error('.\n'.join(msgs))
|
|
178
|
+
|
|
179
|
+
return obj
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class G90PeripheralDefinitionsBase(ABC):
|
|
183
|
+
"""
|
|
184
|
+
Base class for peripheral definitions.
|
|
185
|
+
"""
|
|
186
|
+
@classmethod
|
|
187
|
+
@abstractmethod
|
|
188
|
+
def definitions(cls) -> list[G90PeripheralDefinition]:
|
|
189
|
+
"""
|
|
190
|
+
Get all peripheral definitions.
|
|
191
|
+
|
|
192
|
+
:return: List of peripheral definitions.
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
@classmethod
|
|
196
|
+
def get_by_id(
|
|
197
|
+
cls, id_type: G90PeripheralTypes, id_subtype: int,
|
|
198
|
+
protocol: G90PeripheralProtocols
|
|
199
|
+
) -> G90PeripheralDefinition:
|
|
200
|
+
"""
|
|
201
|
+
Gets peripheral definition by type, subtype and protocol.
|
|
202
|
+
|
|
203
|
+
:param id_type: Peripheral type.
|
|
204
|
+
:param id_subtype: Peripheral subtype.
|
|
205
|
+
:param protocol: Peripheral protocol.
|
|
206
|
+
:raises G90PeripheralDefinitionNotFound: If definition not found.
|
|
207
|
+
"""
|
|
208
|
+
for definition in cls.definitions():
|
|
209
|
+
if (
|
|
210
|
+
definition.type == id_type
|
|
211
|
+
and definition.subtype == id_subtype
|
|
212
|
+
and definition.protocol == protocol
|
|
213
|
+
):
|
|
214
|
+
_LOGGER.debug(
|
|
215
|
+
"Found peripheral definition by"
|
|
216
|
+
" type %d, subtype %d and protocol %d: %s",
|
|
217
|
+
id_type, id_subtype, protocol, definition
|
|
218
|
+
)
|
|
219
|
+
return definition
|
|
220
|
+
|
|
221
|
+
raise G90PeripheralDefinitionNotFound(
|
|
222
|
+
"Peripheral definition not found"
|
|
223
|
+
f" by type={id_type}, subtype={id_subtype}"
|
|
224
|
+
f" and protocol={protocol}",
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
@classmethod
|
|
228
|
+
def get_by_name(
|
|
229
|
+
cls, name: str
|
|
230
|
+
) -> G90PeripheralDefinition:
|
|
231
|
+
"""
|
|
232
|
+
Gets peripheral definition by name.
|
|
233
|
+
|
|
234
|
+
:param name: Peripheral name.
|
|
235
|
+
:raises G90PeripheralDefinitionNotFound: If definition not found.
|
|
236
|
+
"""
|
|
237
|
+
for definition in cls.definitions():
|
|
238
|
+
if definition.name == name:
|
|
239
|
+
_LOGGER.debug(
|
|
240
|
+
"Found peripheral definition by name '%s': %s",
|
|
241
|
+
name, definition
|
|
242
|
+
)
|
|
243
|
+
return definition
|
|
244
|
+
|
|
245
|
+
raise G90PeripheralDefinitionNotFound(
|
|
246
|
+
f"Peripheral definition not found by name='{name}'"
|
|
247
|
+
)
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# Copyright (c) 2025 Ilia Sotnikov
|
|
2
|
+
#
|
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
# furnished to do so, subject to the following conditions:
|
|
9
|
+
#
|
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
|
11
|
+
# all copies or substantial portions of the Software.
|
|
12
|
+
#
|
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
# SOFTWARE.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
Device (relays, sockets) definitions for G90 alarm panel.
|
|
23
|
+
"""
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
import logging
|
|
26
|
+
from .base import (
|
|
27
|
+
G90PeripheralDefinition,
|
|
28
|
+
G90PeripheralDefinitionsBase,
|
|
29
|
+
G90PeripheralTypes,
|
|
30
|
+
G90PeripheralProtocols,
|
|
31
|
+
G90PeripheralRwModes,
|
|
32
|
+
G90PeripheralMatchModes,
|
|
33
|
+
unique_definitions,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
_LOGGER = logging.getLogger(__name__)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@unique_definitions
|
|
40
|
+
class G90DeviceDefinitions(G90PeripheralDefinitionsBase):
|
|
41
|
+
"""
|
|
42
|
+
Device definitions, required when modifying them since
|
|
43
|
+
writing a device to the panel requires values not present on read.
|
|
44
|
+
"""
|
|
45
|
+
DEVICE_DEFINITIONS = [
|
|
46
|
+
G90PeripheralDefinition(
|
|
47
|
+
type=G90PeripheralTypes.CORD_DEV,
|
|
48
|
+
subtype=0,
|
|
49
|
+
rx=0,
|
|
50
|
+
tx=0,
|
|
51
|
+
private_data='00',
|
|
52
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
53
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
54
|
+
name="Wired",
|
|
55
|
+
protocol=G90PeripheralProtocols.CORD,
|
|
56
|
+
timeout=0,
|
|
57
|
+
baudrate=1480,
|
|
58
|
+
node_count=1
|
|
59
|
+
),
|
|
60
|
+
G90PeripheralDefinition(
|
|
61
|
+
type=G90PeripheralTypes.SOCKET,
|
|
62
|
+
subtype=3,
|
|
63
|
+
rx=0,
|
|
64
|
+
tx=2,
|
|
65
|
+
private_data='060A0600',
|
|
66
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
67
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
68
|
+
name="Socket: S07",
|
|
69
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
70
|
+
timeout=0,
|
|
71
|
+
baudrate=1190,
|
|
72
|
+
node_count=1
|
|
73
|
+
),
|
|
74
|
+
G90PeripheralDefinition(
|
|
75
|
+
type=G90PeripheralTypes.SOCKET,
|
|
76
|
+
subtype=0,
|
|
77
|
+
rx=0,
|
|
78
|
+
tx=2,
|
|
79
|
+
private_data='0707070B0B0D0D0E0E00',
|
|
80
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
81
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
82
|
+
name="Socket: JDQ",
|
|
83
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
84
|
+
timeout=0,
|
|
85
|
+
baudrate=1480,
|
|
86
|
+
node_count=4
|
|
87
|
+
),
|
|
88
|
+
G90PeripheralDefinition(
|
|
89
|
+
type=G90PeripheralTypes.SOCKET,
|
|
90
|
+
subtype=1,
|
|
91
|
+
rx=0,
|
|
92
|
+
tx=2,
|
|
93
|
+
private_data='07070700',
|
|
94
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
95
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
96
|
+
name="Socket: Single channel",
|
|
97
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
98
|
+
timeout=0,
|
|
99
|
+
baudrate=1480,
|
|
100
|
+
node_count=1
|
|
101
|
+
),
|
|
102
|
+
G90PeripheralDefinition(
|
|
103
|
+
type=G90PeripheralTypes.SOCKET,
|
|
104
|
+
subtype=4,
|
|
105
|
+
rx=0,
|
|
106
|
+
tx=2,
|
|
107
|
+
private_data='050D0500',
|
|
108
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
109
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
110
|
+
name="Socket Switch",
|
|
111
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
112
|
+
timeout=0,
|
|
113
|
+
baudrate=840,
|
|
114
|
+
node_count=1
|
|
115
|
+
),
|
|
116
|
+
G90PeripheralDefinition(
|
|
117
|
+
type=G90PeripheralTypes.SOCKET,
|
|
118
|
+
subtype=5,
|
|
119
|
+
rx=0,
|
|
120
|
+
tx=2,
|
|
121
|
+
private_data='070A0E080D060B00',
|
|
122
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
123
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
124
|
+
name="Socket: 3 channel",
|
|
125
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
126
|
+
timeout=0,
|
|
127
|
+
baudrate=960,
|
|
128
|
+
node_count=3
|
|
129
|
+
),
|
|
130
|
+
G90PeripheralDefinition(
|
|
131
|
+
type=G90PeripheralTypes.SOCKET,
|
|
132
|
+
subtype=6,
|
|
133
|
+
rx=0,
|
|
134
|
+
tx=2,
|
|
135
|
+
private_data='0B0D0E0B0C090A070800',
|
|
136
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
137
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
138
|
+
name="Socket: 4 channel",
|
|
139
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
140
|
+
timeout=0,
|
|
141
|
+
baudrate=960,
|
|
142
|
+
node_count=4
|
|
143
|
+
),
|
|
144
|
+
G90PeripheralDefinition(
|
|
145
|
+
type=G90PeripheralTypes.CURTAIN,
|
|
146
|
+
subtype=0,
|
|
147
|
+
rx=0,
|
|
148
|
+
tx=7,
|
|
149
|
+
private_data='070B0E0D0C09030100',
|
|
150
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
151
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
152
|
+
name="Curtain: Rolling",
|
|
153
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
154
|
+
timeout=0,
|
|
155
|
+
baudrate=960,
|
|
156
|
+
node_count=1
|
|
157
|
+
),
|
|
158
|
+
G90PeripheralDefinition(
|
|
159
|
+
type=G90PeripheralTypes.CURTAIN,
|
|
160
|
+
subtype=1,
|
|
161
|
+
rx=0,
|
|
162
|
+
tx=7,
|
|
163
|
+
private_data='0804010200',
|
|
164
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
165
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
166
|
+
name="Curtain",
|
|
167
|
+
protocol=G90PeripheralProtocols.RF_SLIDER,
|
|
168
|
+
timeout=0,
|
|
169
|
+
baudrate=500,
|
|
170
|
+
node_count=1
|
|
171
|
+
),
|
|
172
|
+
G90PeripheralDefinition(
|
|
173
|
+
type=G90PeripheralTypes.CURTAIN,
|
|
174
|
+
subtype=1,
|
|
175
|
+
rx=0,
|
|
176
|
+
tx=7,
|
|
177
|
+
private_data='0E0B0E0D0C09030100',
|
|
178
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
179
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
180
|
+
name="Curtain: Sliding",
|
|
181
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
182
|
+
timeout=0,
|
|
183
|
+
baudrate=960,
|
|
184
|
+
node_count=1
|
|
185
|
+
),
|
|
186
|
+
G90PeripheralDefinition(
|
|
187
|
+
type=G90PeripheralTypes.CURTAIN,
|
|
188
|
+
subtype=2,
|
|
189
|
+
rx=0,
|
|
190
|
+
tx=7,
|
|
191
|
+
private_data='070B0E0D0C09030100',
|
|
192
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
193
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
194
|
+
name="Curtain: Push",
|
|
195
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
196
|
+
timeout=0,
|
|
197
|
+
baudrate=960,
|
|
198
|
+
node_count=1
|
|
199
|
+
),
|
|
200
|
+
G90PeripheralDefinition(
|
|
201
|
+
type=G90PeripheralTypes.AIRCON,
|
|
202
|
+
subtype=0,
|
|
203
|
+
rx=0,
|
|
204
|
+
tx=0,
|
|
205
|
+
private_data='00',
|
|
206
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
207
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
208
|
+
name="Air Conditioner",
|
|
209
|
+
protocol=G90PeripheralProtocols.RF_PRIVATE,
|
|
210
|
+
timeout=0,
|
|
211
|
+
baudrate=800,
|
|
212
|
+
node_count=1
|
|
213
|
+
),
|
|
214
|
+
G90PeripheralDefinition(
|
|
215
|
+
type=G90PeripheralTypes.TV,
|
|
216
|
+
subtype=0,
|
|
217
|
+
rx=0,
|
|
218
|
+
tx=0,
|
|
219
|
+
private_data='00',
|
|
220
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
221
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
222
|
+
name="TV",
|
|
223
|
+
protocol=G90PeripheralProtocols.RF_PRIVATE,
|
|
224
|
+
timeout=0,
|
|
225
|
+
baudrate=800,
|
|
226
|
+
node_count=1
|
|
227
|
+
),
|
|
228
|
+
G90PeripheralDefinition(
|
|
229
|
+
type=G90PeripheralTypes.SIREN,
|
|
230
|
+
subtype=0,
|
|
231
|
+
rx=0,
|
|
232
|
+
tx=2,
|
|
233
|
+
private_data='FEFEF600',
|
|
234
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
235
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
236
|
+
name="Siren: SS08",
|
|
237
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
238
|
+
timeout=0,
|
|
239
|
+
baudrate=1480,
|
|
240
|
+
node_count=1
|
|
241
|
+
),
|
|
242
|
+
G90PeripheralDefinition(
|
|
243
|
+
type=G90PeripheralTypes.SIREN,
|
|
244
|
+
subtype=4,
|
|
245
|
+
rx=0,
|
|
246
|
+
tx=2,
|
|
247
|
+
private_data='FEFEF600',
|
|
248
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
249
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
250
|
+
name="Siren: SS07A",
|
|
251
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
252
|
+
timeout=0,
|
|
253
|
+
baudrate=1480,
|
|
254
|
+
node_count=1
|
|
255
|
+
),
|
|
256
|
+
G90PeripheralDefinition(
|
|
257
|
+
type=G90PeripheralTypes.SIREN,
|
|
258
|
+
subtype=5,
|
|
259
|
+
rx=0,
|
|
260
|
+
tx=2,
|
|
261
|
+
private_data='FCFCCF00',
|
|
262
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
263
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
264
|
+
name="Siren: SS04",
|
|
265
|
+
protocol=G90PeripheralProtocols.RF_2262,
|
|
266
|
+
timeout=0,
|
|
267
|
+
baudrate=1480,
|
|
268
|
+
node_count=1
|
|
269
|
+
),
|
|
270
|
+
G90PeripheralDefinition(
|
|
271
|
+
type=G90PeripheralTypes.SIREN,
|
|
272
|
+
subtype=1,
|
|
273
|
+
rx=0,
|
|
274
|
+
tx=2,
|
|
275
|
+
private_data='FCFCCF00',
|
|
276
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
277
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
278
|
+
name="Siren: SS02B",
|
|
279
|
+
protocol=G90PeripheralProtocols.RF_2262,
|
|
280
|
+
timeout=0,
|
|
281
|
+
baudrate=1480,
|
|
282
|
+
node_count=1
|
|
283
|
+
),
|
|
284
|
+
G90PeripheralDefinition(
|
|
285
|
+
type=G90PeripheralTypes.SIREN,
|
|
286
|
+
subtype=2,
|
|
287
|
+
rx=0,
|
|
288
|
+
tx=2,
|
|
289
|
+
private_data='FEFEFD00',
|
|
290
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
291
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
292
|
+
name="Siren: Solar",
|
|
293
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
294
|
+
timeout=0,
|
|
295
|
+
baudrate=2200,
|
|
296
|
+
node_count=1
|
|
297
|
+
),
|
|
298
|
+
G90PeripheralDefinition(
|
|
299
|
+
type=G90PeripheralTypes.NIGHTLIGHT,
|
|
300
|
+
subtype=0,
|
|
301
|
+
rx=0,
|
|
302
|
+
tx=2,
|
|
303
|
+
private_data='060A0600',
|
|
304
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
305
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
306
|
+
name="Night Light",
|
|
307
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
308
|
+
timeout=0,
|
|
309
|
+
baudrate=1190,
|
|
310
|
+
node_count=1
|
|
311
|
+
),
|
|
312
|
+
G90PeripheralDefinition(
|
|
313
|
+
type=G90PeripheralTypes.SOCKET_2_4G,
|
|
314
|
+
subtype=1,
|
|
315
|
+
rx=0,
|
|
316
|
+
tx=0,
|
|
317
|
+
private_data='00',
|
|
318
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
319
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
320
|
+
name="Socket: 2.4G",
|
|
321
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
322
|
+
timeout=0,
|
|
323
|
+
baudrate=960,
|
|
324
|
+
node_count=1
|
|
325
|
+
),
|
|
326
|
+
G90PeripheralDefinition(
|
|
327
|
+
type=G90PeripheralTypes.SIREN_2_4G,
|
|
328
|
+
subtype=1,
|
|
329
|
+
rx=0,
|
|
330
|
+
tx=0,
|
|
331
|
+
private_data='00',
|
|
332
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
333
|
+
match_mode=G90PeripheralMatchModes.ONLY16BITS,
|
|
334
|
+
name="Siren: 2.4G",
|
|
335
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
336
|
+
timeout=0,
|
|
337
|
+
baudrate=2200,
|
|
338
|
+
node_count=1
|
|
339
|
+
),
|
|
340
|
+
G90PeripheralDefinition(
|
|
341
|
+
type=G90PeripheralTypes.CURTAIN_2_4G,
|
|
342
|
+
subtype=1,
|
|
343
|
+
rx=0,
|
|
344
|
+
tx=0,
|
|
345
|
+
private_data='00',
|
|
346
|
+
rw_mode=G90PeripheralRwModes.WRITE,
|
|
347
|
+
match_mode=G90PeripheralMatchModes.ONLY20BITS,
|
|
348
|
+
name="Curtain: 2.4G",
|
|
349
|
+
protocol=G90PeripheralProtocols.RF_1527,
|
|
350
|
+
timeout=0,
|
|
351
|
+
baudrate=960,
|
|
352
|
+
node_count=1
|
|
353
|
+
),
|
|
354
|
+
]
|
|
355
|
+
|
|
356
|
+
@classmethod
|
|
357
|
+
def definitions(cls) -> list[G90PeripheralDefinition]:
|
|
358
|
+
"""
|
|
359
|
+
Gets all device definitions.
|
|
360
|
+
|
|
361
|
+
:return: List of device definitions.
|
|
362
|
+
"""
|
|
363
|
+
_LOGGER.debug(
|
|
364
|
+
"Number of sensor definitions: %d", len(cls.DEVICE_DEFINITIONS)
|
|
365
|
+
)
|
|
366
|
+
return cls.DEVICE_DEFINITIONS
|