pyg90alarm 2.7.0__tar.gz → 2.7.1__tar.gz
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-2.7.0 → pyg90alarm-2.7.1}/PKG-INFO +3 -3
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/README.rst +2 -2
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/alarm.py +11 -11
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/cloud/messages.py +1 -1
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/cloud/notifications.py +12 -10
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/cloud/protocol.py +2 -2
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/const.py +2 -2
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/notifications.py +5 -5
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm.egg-info/PKG-INFO +3 -3
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/device_mock.py +10 -10
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_alarm.py +13 -13
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_cloud_notifications.py +25 -25
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_local_notifications.py +22 -22
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_sensor.py +1 -1
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.github/CODEOWNERS +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.github/dependabot.yml +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.github/workflows/main.yml +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.gitignore +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.pylintrc +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/.readthedocs.yaml +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/LICENSE +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/MANIFEST.in +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/.DS_Store +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/.gitignore +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/api-docs.rst +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/cloud-protocol.rst +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/conf.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/index.rst +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/local-protocol.rst +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/docs/requirements.txt +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/pyproject.toml +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/setup.cfg +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/setup.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/sonar-project.properties +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/callback.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/cloud/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/cloud/const.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/dataclass/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/dataclass/load_save.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/dataclass/validation.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/definitions/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/definitions/base.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/definitions/devices.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/definitions/sensors.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/base_entity.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/base_list.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/device.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/device_list.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/sensor.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/entities/sensor_list.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/event_mapping.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/exceptions.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/alarm_phones.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/alert_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/base_cmd.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/discovery.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/history.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/host_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/host_info.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/host_status.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/net_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/paginated_cmd.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/paginated_result.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/system_cmd.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/targeted_discovery.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/local/user_data_crc.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/notifications/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/notifications/base.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/notifications/protocol.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm/py.typed +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm.egg-info/SOURCES.txt +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm.egg-info/dependency_links.txt +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm.egg-info/requires.txt +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/src/pyg90alarm.egg-info/top_level.txt +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/__init__.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/conftest.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_alarm_phones.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_base_commands.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_devices.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_discovery.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_history.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_host_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_net_config.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_paginated_commands.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/test_system_commands.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_dataclass_load_save.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_dataclass_load_save_serialize.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_validation.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/entities/test_base_list.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/test_exceptions.py +0 -0
- {pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyg90alarm
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.1
|
|
4
4
|
Summary: G90 Alarm system protocol
|
|
5
5
|
Home-page: https://github.com/hostcc/pyg90alarm
|
|
6
6
|
Author: Ilia Sotnikov
|
|
@@ -224,7 +224,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
224
224
|
await alarm.use_cloud_notifications(
|
|
225
225
|
# The host/port the package will listen on for the cloud notifications,
|
|
226
226
|
# should match ones above.
|
|
227
|
-
|
|
227
|
+
cloud_ip='<host IP address running the package>',
|
|
228
228
|
cloud_port=5678,
|
|
229
229
|
cloud_local_port=5678,
|
|
230
230
|
upstream_host=None
|
|
@@ -252,7 +252,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
252
252
|
await alarm.use_cloud_notifications(
|
|
253
253
|
# The host/port the package will listen on for the cloud notifications,
|
|
254
254
|
# should match ones above.
|
|
255
|
-
|
|
255
|
+
cloud_ip='<host IP address running the package>',
|
|
256
256
|
cloud_port=5678,
|
|
257
257
|
cloud_local_port=5678,
|
|
258
258
|
# Upstream cloud server address the package should forward the
|
|
@@ -177,7 +177,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
177
177
|
await alarm.use_cloud_notifications(
|
|
178
178
|
# The host/port the package will listen on for the cloud notifications,
|
|
179
179
|
# should match ones above.
|
|
180
|
-
|
|
180
|
+
cloud_ip='<host IP address running the package>',
|
|
181
181
|
cloud_port=5678,
|
|
182
182
|
cloud_local_port=5678,
|
|
183
183
|
upstream_host=None
|
|
@@ -205,7 +205,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
205
205
|
await alarm.use_cloud_notifications(
|
|
206
206
|
# The host/port the package will listen on for the cloud notifications,
|
|
207
207
|
# should match ones above.
|
|
208
|
-
|
|
208
|
+
cloud_ip='<host IP address running the package>',
|
|
209
209
|
cloud_port=5678,
|
|
210
210
|
cloud_local_port=5678,
|
|
211
211
|
# Upstream cloud server address the package should forward the
|
|
@@ -64,9 +64,9 @@ from .const import (
|
|
|
64
64
|
REMOTE_PORT,
|
|
65
65
|
REMOTE_TARGETED_DISCOVERY_PORT,
|
|
66
66
|
LOCAL_TARGETED_DISCOVERY_PORT,
|
|
67
|
-
|
|
67
|
+
LOCAL_NOTIFICATIONS_IP,
|
|
68
68
|
LOCAL_NOTIFICATIONS_PORT,
|
|
69
|
-
|
|
69
|
+
LOCAL_CLOUD_NOTIFICATIONS_IP,
|
|
70
70
|
LOCAL_CLOUD_NOTIFICATIONS_PORT,
|
|
71
71
|
REMOTE_CLOUD_PORT,
|
|
72
72
|
DEVICE_REGISTRATION_TIMEOUT,
|
|
@@ -1379,7 +1379,7 @@ class G90Alarm(G90NotificationProtocol):
|
|
|
1379
1379
|
await asyncio.sleep(interval)
|
|
1380
1380
|
|
|
1381
1381
|
async def use_local_notifications(
|
|
1382
|
-
self,
|
|
1382
|
+
self, notifications_local_ip: str = LOCAL_NOTIFICATIONS_IP,
|
|
1383
1383
|
notifications_local_port: int = LOCAL_NOTIFICATIONS_PORT
|
|
1384
1384
|
) -> None:
|
|
1385
1385
|
"""
|
|
@@ -1391,16 +1391,16 @@ class G90Alarm(G90NotificationProtocol):
|
|
|
1391
1391
|
protocol_factory=lambda: self,
|
|
1392
1392
|
host=self._host,
|
|
1393
1393
|
port=self._port,
|
|
1394
|
-
|
|
1394
|
+
local_ip=notifications_local_ip,
|
|
1395
1395
|
local_port=notifications_local_port
|
|
1396
1396
|
)
|
|
1397
1397
|
|
|
1398
1398
|
# pylint: disable=too-many-positional-arguments
|
|
1399
1399
|
async def use_cloud_notifications(
|
|
1400
1400
|
self,
|
|
1401
|
-
|
|
1401
|
+
cloud_ip: str,
|
|
1402
1402
|
cloud_port: int,
|
|
1403
|
-
|
|
1403
|
+
cloud_local_ip: str = LOCAL_CLOUD_NOTIFICATIONS_IP,
|
|
1404
1404
|
cloud_local_port: int = LOCAL_CLOUD_NOTIFICATIONS_PORT,
|
|
1405
1405
|
upstream_host: Optional[str] = None,
|
|
1406
1406
|
upstream_port: Optional[int] = REMOTE_CLOUD_PORT,
|
|
@@ -1415,11 +1415,11 @@ class G90Alarm(G90NotificationProtocol):
|
|
|
1415
1415
|
of that is configuring cloud server address on the panel is one-time
|
|
1416
1416
|
operation, while the method will be called multiple times.
|
|
1417
1417
|
|
|
1418
|
-
:param
|
|
1419
|
-
reachable from the panel
|
|
1418
|
+
:param cloud_ip: The IP address of cloud server to connect to, should
|
|
1419
|
+
be reachable from the panel
|
|
1420
1420
|
:param cloud_port: The cloud server port to connect to, should be
|
|
1421
1421
|
reachable from the panel
|
|
1422
|
-
:param
|
|
1422
|
+
:param cloud_local_ip: Local IP address to bind cloud notifications
|
|
1423
1423
|
listener to
|
|
1424
1424
|
:param cloud_local_port: Local port to bind cloud notifications
|
|
1425
1425
|
listener to, should match `cloud_port` above unless network setup
|
|
@@ -1437,9 +1437,9 @@ class G90Alarm(G90NotificationProtocol):
|
|
|
1437
1437
|
protocol_factory=lambda: self,
|
|
1438
1438
|
upstream_host=upstream_host,
|
|
1439
1439
|
upstream_port=upstream_port,
|
|
1440
|
-
|
|
1440
|
+
local_ip=cloud_local_ip,
|
|
1441
1441
|
local_port=cloud_local_port,
|
|
1442
|
-
|
|
1442
|
+
cloud_ip=cloud_ip,
|
|
1443
1443
|
cloud_port=cloud_port,
|
|
1444
1444
|
keep_single_connection=keep_single_connection
|
|
1445
1445
|
)
|
|
@@ -226,7 +226,7 @@ class G90CloudHelloDiscoveryRespMessage(G90CloudMessage):
|
|
|
226
226
|
_LOGGER.debug(
|
|
227
227
|
"%s: Timestamp added: %s", type(self).__name__, str(self)
|
|
228
228
|
)
|
|
229
|
-
self.ip_addr = context.
|
|
229
|
+
self.ip_addr = context.cloud_ip.encode()
|
|
230
230
|
self.port = context.cloud_port
|
|
231
231
|
|
|
232
232
|
@property
|
|
@@ -61,7 +61,9 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
61
61
|
|
|
62
62
|
:param protocol_factory: Factory function to create notification
|
|
63
63
|
protocol handlers
|
|
64
|
-
:param
|
|
64
|
+
:param cloud_ip: Cloud IP address to announce to the panel
|
|
65
|
+
:param cloud_port: Cloud port to announce to the panel
|
|
66
|
+
:param local_ip: Local IP to bind the server to
|
|
65
67
|
:param local_port: Local port to bind the server to
|
|
66
68
|
:param upstream_host: Optional upstream host to forward messages to
|
|
67
69
|
:param upstream_port: Optional upstream port to forward messages to
|
|
@@ -73,8 +75,8 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
73
75
|
def __init__(
|
|
74
76
|
self,
|
|
75
77
|
protocol_factory: Callable[[], G90NotificationProtocol],
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
local_ip: str, local_port: int,
|
|
79
|
+
cloud_ip: str, cloud_port: int,
|
|
78
80
|
upstream_host: Optional[str] = None,
|
|
79
81
|
upstream_port: Optional[int] = None,
|
|
80
82
|
keep_single_connection: bool = True,
|
|
@@ -82,9 +84,9 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
82
84
|
super().__init__(protocol_factory)
|
|
83
85
|
self._transport: Optional[Transport] = None
|
|
84
86
|
self._server: Optional[asyncio.Server] = None
|
|
85
|
-
self.
|
|
87
|
+
self._local_ip = local_ip
|
|
86
88
|
self._local_port = local_port
|
|
87
|
-
self.
|
|
89
|
+
self._cloud_ip = cloud_ip
|
|
88
90
|
self._cloud_port = cloud_port
|
|
89
91
|
self._upstream_host = upstream_host
|
|
90
92
|
self._upstream_port = upstream_port
|
|
@@ -164,9 +166,9 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
164
166
|
# Instantiate a context for the messages
|
|
165
167
|
ctx = G90CloudMessageContext(
|
|
166
168
|
device_id=self.device_id,
|
|
167
|
-
|
|
169
|
+
local_ip=self._local_ip,
|
|
168
170
|
local_port=self._local_port,
|
|
169
|
-
|
|
171
|
+
cloud_ip=self._cloud_ip,
|
|
170
172
|
cloud_port=self._cloud_port,
|
|
171
173
|
upstream_host=self._upstream_host,
|
|
172
174
|
upstream_port=self._upstream_port,
|
|
@@ -373,11 +375,11 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
373
375
|
loop = asyncio.get_running_loop()
|
|
374
376
|
|
|
375
377
|
_LOGGER.debug('Creating cloud endpoint for %s:%s',
|
|
376
|
-
self.
|
|
378
|
+
self._local_ip,
|
|
377
379
|
self._local_port)
|
|
378
380
|
self._server = await loop.create_server(
|
|
379
381
|
lambda: self,
|
|
380
|
-
self.
|
|
382
|
+
self._local_ip, self._local_port
|
|
381
383
|
)
|
|
382
384
|
|
|
383
385
|
async def close(self) -> None:
|
|
@@ -406,7 +408,7 @@ class G90CloudNotifications(G90NotificationsBase, asyncio.Protocol):
|
|
|
406
408
|
if self._server:
|
|
407
409
|
_LOGGER.debug(
|
|
408
410
|
'No longer listening for cloud connections on %s:%s',
|
|
409
|
-
self.
|
|
411
|
+
self._local_ip, self._local_port
|
|
410
412
|
)
|
|
411
413
|
self._server.close()
|
|
412
414
|
self._server = None
|
|
@@ -73,11 +73,11 @@ class G90CloudMessageContext: # pylint:disable=too-many-instance-attributes
|
|
|
73
73
|
This class holds information about the local and remote hosts and ports,
|
|
74
74
|
as well as the cloud server and upstream connection details.
|
|
75
75
|
"""
|
|
76
|
-
|
|
76
|
+
local_ip: str
|
|
77
77
|
local_port: int
|
|
78
78
|
remote_host: str
|
|
79
79
|
remote_port: int
|
|
80
|
-
|
|
80
|
+
cloud_ip: str
|
|
81
81
|
cloud_port: int
|
|
82
82
|
upstream_host: Optional[str]
|
|
83
83
|
upstream_port: Optional[int]
|
|
@@ -28,9 +28,9 @@ from typing import Optional
|
|
|
28
28
|
REMOTE_PORT = 12368
|
|
29
29
|
REMOTE_TARGETED_DISCOVERY_PORT = 12900
|
|
30
30
|
LOCAL_TARGETED_DISCOVERY_PORT = 12901
|
|
31
|
-
|
|
31
|
+
LOCAL_NOTIFICATIONS_IP = '0.0.0.0'
|
|
32
32
|
LOCAL_NOTIFICATIONS_PORT = 12901
|
|
33
|
-
|
|
33
|
+
LOCAL_CLOUD_NOTIFICATIONS_IP = '0.0.0.0'
|
|
34
34
|
LOCAL_CLOUD_NOTIFICATIONS_PORT = 5678
|
|
35
35
|
REMOTE_CLOUD_PORT = 5678
|
|
36
36
|
DEVICE_REGISTRATION_TIMEOUT = 30
|
|
@@ -52,19 +52,19 @@ class G90LocalNotifications(G90NotificationsBase, DatagramProtocol):
|
|
|
52
52
|
:param host: The host on which the device is listening for notifications.
|
|
53
53
|
:param local_port: The port on which the local host is listening for
|
|
54
54
|
notifications.
|
|
55
|
-
:param
|
|
55
|
+
:param local_ip: The IP address on which the local host is listening for
|
|
56
56
|
notifications.
|
|
57
57
|
"""
|
|
58
58
|
# pylint:disable=too-many-positional-arguments,too-many-arguments
|
|
59
59
|
def __init__(
|
|
60
60
|
self, protocol_factory: Callable[[], G90NotificationProtocol],
|
|
61
|
-
port: int, host: str, local_port: int,
|
|
61
|
+
port: int, host: str, local_port: int, local_ip: str,
|
|
62
62
|
):
|
|
63
63
|
super().__init__(protocol_factory)
|
|
64
64
|
|
|
65
65
|
self._host = host
|
|
66
66
|
self._port = port
|
|
67
|
-
self.
|
|
67
|
+
self._notifications_local_ip = local_ip
|
|
68
68
|
self._notifications_local_port = local_port
|
|
69
69
|
|
|
70
70
|
# Implementation of datagram protocol,
|
|
@@ -107,11 +107,11 @@ class G90LocalNotifications(G90NotificationsBase, DatagramProtocol):
|
|
|
107
107
|
loop = asyncio.get_running_loop()
|
|
108
108
|
|
|
109
109
|
_LOGGER.debug('Creating UDP endpoint for %s:%s',
|
|
110
|
-
self.
|
|
110
|
+
self._notifications_local_ip,
|
|
111
111
|
self._notifications_local_port)
|
|
112
112
|
(self._transport,
|
|
113
113
|
_protocol) = await loop.create_datagram_endpoint(
|
|
114
114
|
lambda: self,
|
|
115
115
|
local_addr=(
|
|
116
|
-
self.
|
|
116
|
+
self._notifications_local_ip, self._notifications_local_port
|
|
117
117
|
))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyg90alarm
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.1
|
|
4
4
|
Summary: G90 Alarm system protocol
|
|
5
5
|
Home-page: https://github.com/hostcc/pyg90alarm
|
|
6
6
|
Author: Ilia Sotnikov
|
|
@@ -224,7 +224,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
224
224
|
await alarm.use_cloud_notifications(
|
|
225
225
|
# The host/port the package will listen on for the cloud notifications,
|
|
226
226
|
# should match ones above.
|
|
227
|
-
|
|
227
|
+
cloud_ip='<host IP address running the package>',
|
|
228
228
|
cloud_port=5678,
|
|
229
229
|
cloud_local_port=5678,
|
|
230
230
|
upstream_host=None
|
|
@@ -252,7 +252,7 @@ The code fragments below demonstrate how to utilize both modes - please note tho
|
|
|
252
252
|
await alarm.use_cloud_notifications(
|
|
253
253
|
# The host/port the package will listen on for the cloud notifications,
|
|
254
254
|
# should match ones above.
|
|
255
|
-
|
|
255
|
+
cloud_ip='<host IP address running the package>',
|
|
256
256
|
cloud_port=5678,
|
|
257
257
|
cloud_local_port=5678,
|
|
258
258
|
# Upstream cloud server address the package should forward the
|
|
@@ -397,7 +397,7 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
397
397
|
:param cloud_notification_data: List of TCP payloads to simulate being
|
|
398
398
|
sent from cloud to the client, responses to requests from device
|
|
399
399
|
typically
|
|
400
|
-
:param
|
|
400
|
+
:param cloud_ip: The IP the simulated cloud endpoint listens on for
|
|
401
401
|
client requests
|
|
402
402
|
:param cloud_port: The port the simulated cloud endpoint listens on for
|
|
403
403
|
client requests
|
|
@@ -417,7 +417,7 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
417
417
|
cloud_upstream_data: Optional[List[bytes]] = None,
|
|
418
418
|
device_host: str = '127.0.0.1',
|
|
419
419
|
notification_host: str = '127.0.0.1',
|
|
420
|
-
|
|
420
|
+
cloud_ip: str = '127.0.0.1',
|
|
421
421
|
cloud_port: int = 5678,
|
|
422
422
|
cloud_upstream_host: str = '127.0.0.1',
|
|
423
423
|
cloud_upstream_port: int = 5678,
|
|
@@ -436,7 +436,7 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
436
436
|
] = None
|
|
437
437
|
self._cloud_data = cloud_notification_data or []
|
|
438
438
|
self._cloud_recv_data: List[bytes] = []
|
|
439
|
-
self.
|
|
439
|
+
self._cloud_ip = cloud_ip
|
|
440
440
|
self._cloud_port = cloud_port
|
|
441
441
|
self._cloud_upstream_data = cloud_upstream_data
|
|
442
442
|
self._cloud_upstream_host = cloud_upstream_host
|
|
@@ -532,13 +532,13 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
532
532
|
return self._notification_data
|
|
533
533
|
|
|
534
534
|
@property
|
|
535
|
-
def
|
|
535
|
+
def cloud_ip(self) -> str:
|
|
536
536
|
"""
|
|
537
|
-
Returns the
|
|
537
|
+
Returns the IP address the simulated cloud endpoint listens on.
|
|
538
538
|
|
|
539
|
-
:return:
|
|
539
|
+
:return: IP address
|
|
540
540
|
"""
|
|
541
|
-
return self.
|
|
541
|
+
return self._cloud_ip
|
|
542
542
|
|
|
543
543
|
@property
|
|
544
544
|
def cloud_port(self) -> int:
|
|
@@ -683,7 +683,7 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
683
683
|
if not self._cloud_notification_protocol:
|
|
684
684
|
_LOGGER.debug(
|
|
685
685
|
'Creating TCP cloud client to %s:%s',
|
|
686
|
-
self.
|
|
686
|
+
self._cloud_ip,
|
|
687
687
|
self._cloud_port
|
|
688
688
|
)
|
|
689
689
|
|
|
@@ -693,11 +693,11 @@ class DeviceMock: # pylint:disable=too-many-instance-attributes
|
|
|
693
693
|
self._cloud_notification_protocol
|
|
694
694
|
) = await loop.create_connection(
|
|
695
695
|
lambda: MockCloudProtocol(self._cloud_data),
|
|
696
|
-
host=self.
|
|
696
|
+
host=self._cloud_ip, port=self._cloud_port
|
|
697
697
|
)
|
|
698
698
|
|
|
699
699
|
self._cloud_notification_protocol.send_data(
|
|
700
|
-
(self.
|
|
700
|
+
(self._cloud_ip, self._cloud_port)
|
|
701
701
|
)
|
|
702
702
|
await asyncio.wait(
|
|
703
703
|
[self._cloud_notification_protocol.is_done]
|
|
@@ -237,7 +237,7 @@ async def test_sensor_callback(
|
|
|
237
237
|
reset_occupancy_interval=reset_interval
|
|
238
238
|
)
|
|
239
239
|
await g90.use_local_notifications(
|
|
240
|
-
|
|
240
|
+
notifications_local_ip=mock_device.notification_host,
|
|
241
241
|
notifications_local_port=mock_device.notification_port
|
|
242
242
|
)
|
|
243
243
|
|
|
@@ -287,7 +287,7 @@ async def test_sensor_low_battery_callback(mock_device: DeviceMock) -> None:
|
|
|
287
287
|
"""
|
|
288
288
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
289
289
|
await g90.use_local_notifications(
|
|
290
|
-
|
|
290
|
+
notifications_local_ip=mock_device.notification_host,
|
|
291
291
|
notifications_local_port=mock_device.notification_port
|
|
292
292
|
)
|
|
293
293
|
|
|
@@ -340,7 +340,7 @@ async def test_sensor_door_open_when_arming_callback(
|
|
|
340
340
|
"""
|
|
341
341
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
342
342
|
await g90.use_local_notifications(
|
|
343
|
-
|
|
343
|
+
notifications_local_ip=mock_device.notification_host,
|
|
344
344
|
notifications_local_port=mock_device.notification_port
|
|
345
345
|
)
|
|
346
346
|
|
|
@@ -399,7 +399,7 @@ async def test_armdisarm_callback(mock_device: DeviceMock) -> None:
|
|
|
399
399
|
armdisarm_cb.side_effect = lambda *args: future.set_result(True)
|
|
400
400
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
401
401
|
await g90.use_local_notifications(
|
|
402
|
-
|
|
402
|
+
notifications_local_ip=mock_device.notification_host,
|
|
403
403
|
notifications_local_port=mock_device.notification_port
|
|
404
404
|
)
|
|
405
405
|
g90.armdisarm_callback = armdisarm_cb
|
|
@@ -434,7 +434,7 @@ async def test_door_open_close_callback(mock_device: DeviceMock) -> None:
|
|
|
434
434
|
|
|
435
435
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
436
436
|
await g90.use_local_notifications(
|
|
437
|
-
|
|
437
|
+
notifications_local_ip=mock_device.notification_host,
|
|
438
438
|
notifications_local_port=mock_device.notification_port
|
|
439
439
|
)
|
|
440
440
|
g90.door_open_close_callback = door_open_close_cb
|
|
@@ -494,7 +494,7 @@ async def test_alarm_callback(mock_device: DeviceMock) -> None:
|
|
|
494
494
|
|
|
495
495
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
496
496
|
await g90.use_local_notifications(
|
|
497
|
-
|
|
497
|
+
notifications_local_ip=mock_device.notification_host,
|
|
498
498
|
notifications_local_port=mock_device.notification_port
|
|
499
499
|
)
|
|
500
500
|
sensors = await g90.sensors
|
|
@@ -579,7 +579,7 @@ async def test_sensor_tamper_callback(
|
|
|
579
579
|
"""
|
|
580
580
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
581
581
|
await g90.use_local_notifications(
|
|
582
|
-
|
|
582
|
+
notifications_local_ip=mock_device.notification_host,
|
|
583
583
|
notifications_local_port=mock_device.notification_port
|
|
584
584
|
)
|
|
585
585
|
|
|
@@ -645,7 +645,7 @@ async def test_sos_callback(mock_device: DeviceMock) -> None:
|
|
|
645
645
|
|
|
646
646
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
647
647
|
await g90.use_local_notifications(
|
|
648
|
-
|
|
648
|
+
notifications_local_ip=mock_device.notification_host,
|
|
649
649
|
notifications_local_port=mock_device.notification_port
|
|
650
650
|
)
|
|
651
651
|
g90.sos_callback = sos_cb
|
|
@@ -708,7 +708,7 @@ async def test_remote_button_callback(mock_device: DeviceMock) -> None:
|
|
|
708
708
|
|
|
709
709
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
710
710
|
await g90.use_local_notifications(
|
|
711
|
-
|
|
711
|
+
notifications_local_ip=mock_device.notification_host,
|
|
712
712
|
notifications_local_port=mock_device.notification_port
|
|
713
713
|
)
|
|
714
714
|
g90.sensor_callback = sensor_cb
|
|
@@ -748,7 +748,7 @@ async def test_rfid_callback(mock_device: DeviceMock) -> None:
|
|
|
748
748
|
|
|
749
749
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
750
750
|
await g90.use_local_notifications(
|
|
751
|
-
|
|
751
|
+
notifications_local_ip=mock_device.notification_host,
|
|
752
752
|
notifications_local_port=mock_device.notification_port
|
|
753
753
|
)
|
|
754
754
|
g90.sensor_callback = sensor_cb
|
|
@@ -789,7 +789,7 @@ async def test_rfid_low_battery_callback(mock_device: DeviceMock) -> None:
|
|
|
789
789
|
|
|
790
790
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
791
791
|
await g90.use_local_notifications(
|
|
792
|
-
|
|
792
|
+
notifications_local_ip=mock_device.notification_host,
|
|
793
793
|
notifications_local_port=mock_device.notification_port
|
|
794
794
|
)
|
|
795
795
|
g90.sensor_callback = sensor_cb
|
|
@@ -879,7 +879,7 @@ async def test_sms_alert_when_armed(mock_device: DeviceMock) -> None:
|
|
|
879
879
|
armdisarm_cb.side_effect = lambda *args: future.set_result(True)
|
|
880
880
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
881
881
|
await g90.use_local_notifications(
|
|
882
|
-
|
|
882
|
+
notifications_local_ip=mock_device.notification_host,
|
|
883
883
|
notifications_local_port=mock_device.notification_port
|
|
884
884
|
)
|
|
885
885
|
g90.armdisarm_callback = armdisarm_cb
|
|
@@ -919,7 +919,7 @@ async def test_sms_alert_when_disarmed(mock_device: DeviceMock) -> None:
|
|
|
919
919
|
armdisarm_cb.side_effect = lambda *args: future.set_result(True)
|
|
920
920
|
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
921
921
|
await g90.use_local_notifications(
|
|
922
|
-
|
|
922
|
+
notifications_local_ip=mock_device.notification_host,
|
|
923
923
|
notifications_local_port=mock_device.notification_port
|
|
924
924
|
)
|
|
925
925
|
g90.armdisarm_callback = armdisarm_cb
|
|
@@ -55,9 +55,9 @@ async def test_cloud_short_header(
|
|
|
55
55
|
"""
|
|
56
56
|
notifications = G90CloudNotifications(
|
|
57
57
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
58
|
-
|
|
58
|
+
cloud_ip=mock_device.cloud_ip,
|
|
59
59
|
cloud_port=mock_device.cloud_port,
|
|
60
|
-
|
|
60
|
+
local_ip=mock_device.cloud_ip,
|
|
61
61
|
local_port=mock_device.cloud_port
|
|
62
62
|
)
|
|
63
63
|
await notifications.listen()
|
|
@@ -77,9 +77,9 @@ async def test_cloud_short_packet(
|
|
|
77
77
|
"""
|
|
78
78
|
notifications = G90CloudNotifications(
|
|
79
79
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
80
|
-
|
|
80
|
+
cloud_ip=mock_device.cloud_ip,
|
|
81
81
|
cloud_port=mock_device.cloud_port,
|
|
82
|
-
|
|
82
|
+
local_ip=mock_device.cloud_ip,
|
|
83
83
|
local_port=mock_device.cloud_port
|
|
84
84
|
)
|
|
85
85
|
future = data_receive_awaitable(notifications)
|
|
@@ -102,9 +102,9 @@ async def test_cloud_ping(
|
|
|
102
102
|
"""
|
|
103
103
|
notifications = G90CloudNotifications(
|
|
104
104
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
105
|
-
|
|
105
|
+
cloud_ip=mock_device.cloud_ip,
|
|
106
106
|
cloud_port=mock_device.cloud_port,
|
|
107
|
-
|
|
107
|
+
local_ip=mock_device.cloud_ip,
|
|
108
108
|
local_port=mock_device.cloud_port
|
|
109
109
|
)
|
|
110
110
|
future = data_receive_awaitable(notifications)
|
|
@@ -135,9 +135,9 @@ async def test_cloud_hello(
|
|
|
135
135
|
"""
|
|
136
136
|
notifications = G90CloudNotifications(
|
|
137
137
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
138
|
-
|
|
138
|
+
cloud_ip=mock_device.cloud_ip,
|
|
139
139
|
cloud_port=mock_device.cloud_port,
|
|
140
|
-
|
|
140
|
+
local_ip=mock_device.cloud_ip,
|
|
141
141
|
local_port=mock_device.cloud_port
|
|
142
142
|
)
|
|
143
143
|
future = data_receive_awaitable(notifications)
|
|
@@ -172,9 +172,9 @@ async def test_cloud_hello_wrong_version(
|
|
|
172
172
|
"""
|
|
173
173
|
notifications = G90CloudNotifications(
|
|
174
174
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
175
|
-
|
|
175
|
+
cloud_ip=mock_device.cloud_ip,
|
|
176
176
|
cloud_port=mock_device.cloud_port,
|
|
177
|
-
|
|
177
|
+
local_ip=mock_device.cloud_ip,
|
|
178
178
|
local_port=mock_device.cloud_port
|
|
179
179
|
)
|
|
180
180
|
future = data_receive_awaitable(notifications)
|
|
@@ -202,9 +202,9 @@ async def test_cloud_hello_discovery(
|
|
|
202
202
|
"""
|
|
203
203
|
notifications = G90CloudNotifications(
|
|
204
204
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
205
|
-
|
|
205
|
+
cloud_ip=mock_device.cloud_ip,
|
|
206
206
|
cloud_port=mock_device.cloud_port,
|
|
207
|
-
|
|
207
|
+
local_ip=mock_device.cloud_ip,
|
|
208
208
|
local_port=mock_device.cloud_port
|
|
209
209
|
)
|
|
210
210
|
|
|
@@ -216,7 +216,7 @@ async def test_cloud_hello_discovery(
|
|
|
216
216
|
await notifications.close()
|
|
217
217
|
assert (
|
|
218
218
|
b'\x01\xd0\x00\x10\x2c\x00\x00\x00\x01\x00\x00\x00'
|
|
219
|
-
+ mock_device.
|
|
219
|
+
+ mock_device.cloud_ip.encode()
|
|
220
220
|
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
|
221
221
|
b'\x00\x00\x00\x00\x00'
|
|
222
222
|
+ pack('<i', mock_device.cloud_port)
|
|
@@ -245,9 +245,9 @@ async def test_cloud_notification(
|
|
|
245
245
|
mock = MagicMock(spec=G90NotificationProtocol)
|
|
246
246
|
notifications = G90CloudNotifications(
|
|
247
247
|
protocol_factory=lambda: mock,
|
|
248
|
-
|
|
248
|
+
cloud_ip=mock_device.cloud_ip,
|
|
249
249
|
cloud_port=mock_device.cloud_port,
|
|
250
|
-
|
|
250
|
+
local_ip=mock_device.cloud_ip,
|
|
251
251
|
local_port=mock_device.cloud_port
|
|
252
252
|
)
|
|
253
253
|
future = asyncio.get_running_loop().create_future()
|
|
@@ -289,9 +289,9 @@ async def test_cloud_status_change_disarm(
|
|
|
289
289
|
mock = MagicMock(spec=G90NotificationProtocol)
|
|
290
290
|
notifications = G90CloudNotifications(
|
|
291
291
|
protocol_factory=lambda: mock,
|
|
292
|
-
|
|
292
|
+
cloud_ip=mock_device.cloud_ip,
|
|
293
293
|
cloud_port=mock_device.cloud_port,
|
|
294
|
-
|
|
294
|
+
local_ip=mock_device.cloud_ip,
|
|
295
295
|
local_port=mock_device.cloud_port
|
|
296
296
|
)
|
|
297
297
|
future = asyncio.get_running_loop().create_future()
|
|
@@ -373,9 +373,9 @@ async def test_cloud_status_change_alarm_sensor(
|
|
|
373
373
|
mock = MagicMock(spec=G90NotificationProtocol)
|
|
374
374
|
notifications = G90CloudNotifications(
|
|
375
375
|
protocol_factory=lambda: mock,
|
|
376
|
-
|
|
376
|
+
cloud_ip=mock_device.cloud_ip,
|
|
377
377
|
cloud_port=mock_device.cloud_port,
|
|
378
|
-
|
|
378
|
+
local_ip=mock_device.cloud_ip,
|
|
379
379
|
local_port=mock_device.cloud_port
|
|
380
380
|
)
|
|
381
381
|
future = asyncio.get_running_loop().create_future()
|
|
@@ -416,9 +416,9 @@ async def test_cloud_status_change_sensor_activity(
|
|
|
416
416
|
mock = MagicMock(spec=G90NotificationProtocol)
|
|
417
417
|
notifications = G90CloudNotifications(
|
|
418
418
|
protocol_factory=lambda: mock,
|
|
419
|
-
|
|
419
|
+
cloud_ip=mock_device.cloud_ip,
|
|
420
420
|
cloud_port=mock_device.cloud_port,
|
|
421
|
-
|
|
421
|
+
local_ip=mock_device.cloud_ip,
|
|
422
422
|
local_port=mock_device.cloud_port
|
|
423
423
|
)
|
|
424
424
|
future = asyncio.get_running_loop().create_future()
|
|
@@ -449,9 +449,9 @@ async def test_cloud_command(
|
|
|
449
449
|
"""
|
|
450
450
|
notifications = G90CloudNotifications(
|
|
451
451
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
452
|
-
|
|
452
|
+
cloud_ip=mock_device.cloud_ip,
|
|
453
453
|
cloud_port=mock_device.cloud_port,
|
|
454
|
-
|
|
454
|
+
local_ip=mock_device.cloud_ip,
|
|
455
455
|
local_port=mock_device.cloud_port
|
|
456
456
|
)
|
|
457
457
|
future = data_receive_awaitable(notifications)
|
|
@@ -506,9 +506,9 @@ async def test_upstream_cloud_hello(
|
|
|
506
506
|
"""
|
|
507
507
|
notifications = G90CloudNotifications(
|
|
508
508
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
509
|
-
|
|
509
|
+
cloud_ip=mock_device.cloud_ip,
|
|
510
510
|
cloud_port=mock_device.cloud_port,
|
|
511
|
-
|
|
511
|
+
local_ip=mock_device.cloud_ip,
|
|
512
512
|
local_port=mock_device.cloud_port,
|
|
513
513
|
upstream_host=mock_device.cloud_upstream_host,
|
|
514
514
|
upstream_port=mock_device.cloud_upstream_port
|
|
@@ -31,7 +31,7 @@ async def test_device_notification_invalid_utf_data(
|
|
|
31
31
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
32
32
|
host=mock_device.host,
|
|
33
33
|
port=mock_device.port,
|
|
34
|
-
|
|
34
|
+
local_ip=mock_device.notification_host,
|
|
35
35
|
local_port=mock_device.notification_port
|
|
36
36
|
)
|
|
37
37
|
future = data_receive_awaitable(notifications)
|
|
@@ -60,7 +60,7 @@ async def test_device_notification_missing_header(
|
|
|
60
60
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
61
61
|
host=mock_device.host,
|
|
62
62
|
port=mock_device.port,
|
|
63
|
-
|
|
63
|
+
local_ip=mock_device.notification_host,
|
|
64
64
|
local_port=mock_device.notification_port
|
|
65
65
|
)
|
|
66
66
|
future = data_receive_awaitable(notifications)
|
|
@@ -93,7 +93,7 @@ async def test_device_notification_malformed_message(
|
|
|
93
93
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
94
94
|
host=mock_device.host,
|
|
95
95
|
port=mock_device.port,
|
|
96
|
-
|
|
96
|
+
local_ip=mock_device.notification_host,
|
|
97
97
|
local_port=mock_device.notification_port
|
|
98
98
|
)
|
|
99
99
|
future = data_receive_awaitable(notifications)
|
|
@@ -124,7 +124,7 @@ async def test_device_notification_missing_end_marker(
|
|
|
124
124
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
125
125
|
host=mock_device.host,
|
|
126
126
|
port=mock_device.port,
|
|
127
|
-
|
|
127
|
+
local_ip=mock_device.notification_host,
|
|
128
128
|
local_port=mock_device.notification_port
|
|
129
129
|
)
|
|
130
130
|
future = data_receive_awaitable(notifications)
|
|
@@ -151,7 +151,7 @@ async def test_wrong_device_notification_format(
|
|
|
151
151
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
152
152
|
host=mock_device.host,
|
|
153
153
|
port=mock_device.port,
|
|
154
|
-
|
|
154
|
+
local_ip=mock_device.notification_host,
|
|
155
155
|
local_port=mock_device.notification_port
|
|
156
156
|
)
|
|
157
157
|
future = data_receive_awaitable(notifications)
|
|
@@ -182,7 +182,7 @@ async def test_wrong_device_alert_format(
|
|
|
182
182
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
183
183
|
host=mock_device.host,
|
|
184
184
|
port=mock_device.port,
|
|
185
|
-
|
|
185
|
+
local_ip=mock_device.notification_host,
|
|
186
186
|
local_port=mock_device.notification_port
|
|
187
187
|
)
|
|
188
188
|
future = data_receive_awaitable(notifications)
|
|
@@ -215,7 +215,7 @@ async def test_unknown_device_notification(
|
|
|
215
215
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
216
216
|
host=mock_device.host,
|
|
217
217
|
port=mock_device.port,
|
|
218
|
-
|
|
218
|
+
local_ip=mock_device.notification_host,
|
|
219
219
|
local_port=mock_device.notification_port
|
|
220
220
|
)
|
|
221
221
|
future = data_receive_awaitable(notifications)
|
|
@@ -247,7 +247,7 @@ async def test_unknown_device_alert(
|
|
|
247
247
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
248
248
|
host=mock_device.host,
|
|
249
249
|
port=mock_device.port,
|
|
250
|
-
|
|
250
|
+
local_ip=mock_device.notification_host,
|
|
251
251
|
local_port=mock_device.notification_port
|
|
252
252
|
)
|
|
253
253
|
future = data_receive_awaitable(notifications)
|
|
@@ -281,7 +281,7 @@ async def test_wrong_host(
|
|
|
281
281
|
protocol_factory=lambda: MagicMock(spec=G90NotificationProtocol),
|
|
282
282
|
host='1.2.3.4',
|
|
283
283
|
port=mock_device.port,
|
|
284
|
-
|
|
284
|
+
local_ip=mock_device.notification_host,
|
|
285
285
|
local_port=mock_device.notification_port
|
|
286
286
|
)
|
|
287
287
|
future = data_receive_awaitable(notifications)
|
|
@@ -322,7 +322,7 @@ async def test_empty_device_guid(mock_device: DeviceMock) -> None:
|
|
|
322
322
|
host=mock_device.host, port=mock_device.port
|
|
323
323
|
)
|
|
324
324
|
await g90.use_local_notifications(
|
|
325
|
-
|
|
325
|
+
notifications_local_ip=mock_device.notification_host,
|
|
326
326
|
notifications_local_port=mock_device.notification_port
|
|
327
327
|
)
|
|
328
328
|
# The command will fetch the host info and store the GIUD
|
|
@@ -346,7 +346,7 @@ async def test_wrong_device_guid(
|
|
|
346
346
|
notifications = G90LocalNotifications(
|
|
347
347
|
protocol_factory=lambda: mock,
|
|
348
348
|
host=mock_device.host, port=mock_device.port,
|
|
349
|
-
|
|
349
|
+
local_ip=mock_device.notification_host,
|
|
350
350
|
local_port=mock_device.notification_port
|
|
351
351
|
)
|
|
352
352
|
future = data_receive_awaitable(notifications)
|
|
@@ -378,7 +378,7 @@ async def test_sensor_callback(mock_device: DeviceMock) -> None:
|
|
|
378
378
|
notifications = G90LocalNotifications(
|
|
379
379
|
protocol_factory=lambda: mock,
|
|
380
380
|
host=mock_device.host, port=mock_device.port,
|
|
381
|
-
|
|
381
|
+
local_ip=mock_device.notification_host,
|
|
382
382
|
local_port=mock_device.notification_port
|
|
383
383
|
)
|
|
384
384
|
|
|
@@ -411,7 +411,7 @@ async def test_armdisarm_notification_callback(
|
|
|
411
411
|
notifications = G90LocalNotifications(
|
|
412
412
|
protocol_factory=lambda: mock,
|
|
413
413
|
host=mock_device.host, port=mock_device.port,
|
|
414
|
-
|
|
414
|
+
local_ip=mock_device.notification_host,
|
|
415
415
|
local_port=mock_device.notification_port
|
|
416
416
|
)
|
|
417
417
|
|
|
@@ -437,7 +437,7 @@ async def test_armdisarm_alert_callback(mock_device: DeviceMock) -> None:
|
|
|
437
437
|
notifications = G90LocalNotifications(
|
|
438
438
|
protocol_factory=lambda: mock,
|
|
439
439
|
host=mock_device.host, port=mock_device.port,
|
|
440
|
-
|
|
440
|
+
local_ip=mock_device.notification_host,
|
|
441
441
|
local_port=mock_device.notification_port
|
|
442
442
|
)
|
|
443
443
|
|
|
@@ -463,7 +463,7 @@ async def test_door_open_callback(mock_device: DeviceMock) -> None:
|
|
|
463
463
|
notifications = G90LocalNotifications(
|
|
464
464
|
protocol_factory=lambda: mock,
|
|
465
465
|
host=mock_device.host, port=mock_device.port,
|
|
466
|
-
|
|
466
|
+
local_ip=mock_device.notification_host,
|
|
467
467
|
local_port=mock_device.notification_port
|
|
468
468
|
)
|
|
469
469
|
|
|
@@ -489,7 +489,7 @@ async def test_door_close_callback(mock_device: DeviceMock) -> None:
|
|
|
489
489
|
notifications = G90LocalNotifications(
|
|
490
490
|
protocol_factory=lambda: mock,
|
|
491
491
|
host=mock_device.host, port=mock_device.port,
|
|
492
|
-
|
|
492
|
+
local_ip=mock_device.notification_host,
|
|
493
493
|
local_port=mock_device.notification_port
|
|
494
494
|
)
|
|
495
495
|
|
|
@@ -517,7 +517,7 @@ async def test_doorbell_callback(mock_device: DeviceMock) -> None:
|
|
|
517
517
|
notifications = G90LocalNotifications(
|
|
518
518
|
protocol_factory=lambda: mock,
|
|
519
519
|
host=mock_device.host, port=mock_device.port,
|
|
520
|
-
|
|
520
|
+
local_ip=mock_device.notification_host,
|
|
521
521
|
local_port=mock_device.notification_port
|
|
522
522
|
)
|
|
523
523
|
|
|
@@ -545,7 +545,7 @@ async def test_alarm_callback(mock_device: DeviceMock) -> None:
|
|
|
545
545
|
notifications = G90LocalNotifications(
|
|
546
546
|
protocol_factory=lambda: mock,
|
|
547
547
|
host=mock_device.host, port=mock_device.port,
|
|
548
|
-
|
|
548
|
+
local_ip=mock_device.notification_host,
|
|
549
549
|
local_port=mock_device.notification_port
|
|
550
550
|
)
|
|
551
551
|
|
|
@@ -572,7 +572,7 @@ async def test_tamper_callback(mock_device: DeviceMock) -> None:
|
|
|
572
572
|
notifications = G90LocalNotifications(
|
|
573
573
|
protocol_factory=lambda: mock,
|
|
574
574
|
host=mock_device.host, port=mock_device.port,
|
|
575
|
-
|
|
575
|
+
local_ip=mock_device.notification_host,
|
|
576
576
|
local_port=mock_device.notification_port
|
|
577
577
|
)
|
|
578
578
|
|
|
@@ -601,7 +601,7 @@ async def test_sos_callback(mock_device: DeviceMock) -> None:
|
|
|
601
601
|
notifications = G90LocalNotifications(
|
|
602
602
|
protocol_factory=lambda: mock,
|
|
603
603
|
host=mock_device.host, port=mock_device.port,
|
|
604
|
-
|
|
604
|
+
local_ip=mock_device.notification_host,
|
|
605
605
|
local_port=mock_device.notification_port
|
|
606
606
|
)
|
|
607
607
|
|
|
@@ -637,7 +637,7 @@ async def test_low_battery_callback(mock_device: DeviceMock) -> None:
|
|
|
637
637
|
notifications = G90LocalNotifications(
|
|
638
638
|
protocol_factory=lambda: mock,
|
|
639
639
|
host=mock_device.host, port=mock_device.port,
|
|
640
|
-
|
|
640
|
+
local_ip=mock_device.notification_host,
|
|
641
641
|
local_port=mock_device.notification_port
|
|
642
642
|
)
|
|
643
643
|
|
|
@@ -663,7 +663,7 @@ async def test_door_open_when_arming_callback(mock_device: DeviceMock) -> None:
|
|
|
663
663
|
notifications = G90LocalNotifications(
|
|
664
664
|
protocol_factory=lambda: mock,
|
|
665
665
|
host=mock_device.host, port=mock_device.port,
|
|
666
|
-
|
|
666
|
+
local_ip=mock_device.notification_host,
|
|
667
667
|
local_port=mock_device.notification_port
|
|
668
668
|
)
|
|
669
669
|
|
|
@@ -491,7 +491,7 @@ async def test_sensor_register(
|
|
|
491
491
|
# Setup the notifications, since those are required to complete the
|
|
492
492
|
# registration process
|
|
493
493
|
await g90.use_local_notifications(
|
|
494
|
-
|
|
494
|
+
notifications_local_ip=mock_device.notification_host,
|
|
495
495
|
notifications_local_port=mock_device.notification_port
|
|
496
496
|
)
|
|
497
497
|
await g90.listen_notifications()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py
RENAMED
|
File without changes
|
{pyg90alarm-2.7.0 → pyg90alarm-2.7.1}/tests/unit/dataclass/test_dataclass_load_save_serialize.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|