pyg90alarm 2.5.2__tar.gz → 2.5.3__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.5.2 → pyg90alarm-2.5.3}/PKG-INFO +1 -1
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/net_config.py +15 -1
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm.egg-info/PKG-INFO +1 -1
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_net_config.py +55 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.github/CODEOWNERS +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.github/dependabot.yml +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.github/workflows/main.yml +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.gitignore +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.pylintrc +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/.readthedocs.yaml +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/LICENSE +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/MANIFEST.in +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/README.rst +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/.DS_Store +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/.gitignore +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/api-docs.rst +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/cloud-protocol.rst +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/conf.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/index.rst +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/local-protocol.rst +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/docs/requirements.txt +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/pyproject.toml +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/setup.cfg +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/setup.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/sonar-project.properties +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/alarm.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/callback.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/cloud/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/cloud/const.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/cloud/messages.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/cloud/notifications.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/cloud/protocol.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/const.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/dataclass/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/dataclass/load_save.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/dataclass/validation.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/definitions/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/definitions/base.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/definitions/devices.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/definitions/sensors.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/base_entity.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/base_list.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/device.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/device_list.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/sensor.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/entities/sensor_list.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/event_mapping.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/exceptions.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/alarm_phones.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/alert_config.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/base_cmd.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/config.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/discovery.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/history.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/host_config.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/host_info.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/host_status.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/notifications.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/paginated_cmd.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/paginated_result.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/targeted_discovery.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/local/user_data_crc.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/notifications/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/notifications/base.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/notifications/protocol.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm/py.typed +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm.egg-info/SOURCES.txt +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm.egg-info/dependency_links.txt +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm.egg-info/requires.txt +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/src/pyg90alarm.egg-info/top_level.txt +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/__init__.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/conftest.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/device_mock.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_alarm.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_alarm_phones.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_base_commands.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_cloud_notifications.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_config.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_devices.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_discovery.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_history.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_host_config.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_local_notifications.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_paginated_commands.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/test_sensor.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/dataclass/test_dataclass_load_save.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/dataclass/test_dataclass_load_save_serialize.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/dataclass/test_validation.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/entities/test_base_list.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tests/unit/test_exceptions.py +0 -0
- {pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/tox.ini +0 -0
|
@@ -132,8 +132,22 @@ class G90NetConfig(DataclassLoadSave):
|
|
|
132
132
|
def apn_auth(self) -> G90APNAuth:
|
|
133
133
|
"""
|
|
134
134
|
Returns the APN authentication method as an enum.
|
|
135
|
+
|
|
136
|
+
Some panels might send values outside of the defined enum range,
|
|
137
|
+
presumably when SIM card is absent. In such cases, returns
|
|
138
|
+
`G90APNAuth.NONE`.
|
|
139
|
+
|
|
140
|
+
No attempt is made to correct the invalid value in the underlying
|
|
141
|
+
data field, since the panel is trusted - unless the value is modified
|
|
142
|
+
and saved back to the device.
|
|
143
|
+
|
|
144
|
+
:return: APN authentication method, or G90APNAuth.NONE if the received
|
|
145
|
+
value is invalid.
|
|
135
146
|
"""
|
|
136
|
-
|
|
147
|
+
try:
|
|
148
|
+
return G90APNAuth(self._apn_auth)
|
|
149
|
+
except ValueError:
|
|
150
|
+
return G90APNAuth.NONE
|
|
137
151
|
|
|
138
152
|
@apn_auth.setter
|
|
139
153
|
def apn_auth(self, value: G90APNAuth) -> None:
|
|
@@ -190,3 +190,58 @@ async def test_net_config_apn_name_empty(
|
|
|
190
190
|
b'[0,"123456789",1,1,"","user","pwd",3]'
|
|
191
191
|
b']]IEND\0'
|
|
192
192
|
]
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
@pytest.mark.parametrize('new_apn_auth_value,expected_recv_data', [
|
|
196
|
+
# Verify the invalid value is retained, since the panel is trusted, if no
|
|
197
|
+
# modifications to the value is made
|
|
198
|
+
pytest.param(
|
|
199
|
+
None, [
|
|
200
|
+
b'ISTART[212,212,""]IEND\0',
|
|
201
|
+
b'ISTART[213,213,[213,'
|
|
202
|
+
b'[0,"123456789",1,1,"","user","pwd",333]'
|
|
203
|
+
b']]IEND\0'
|
|
204
|
+
], id='Device with invalid APN auth value unmodified'
|
|
205
|
+
),
|
|
206
|
+
# Verify the invalid value is replaced with valid one when modified
|
|
207
|
+
pytest.param(
|
|
208
|
+
G90APNAuth.PAP, [
|
|
209
|
+
b'ISTART[212,212,""]IEND\0',
|
|
210
|
+
b'ISTART[213,213,[213,'
|
|
211
|
+
b'[0,"123456789",1,1,"","user","pwd",1]'
|
|
212
|
+
b']]IEND\0'
|
|
213
|
+
], id='Device with invalid APN auth value modified to valid value'
|
|
214
|
+
),
|
|
215
|
+
])
|
|
216
|
+
@pytest.mark.g90device(sent_data=[
|
|
217
|
+
b'ISTART[212,'
|
|
218
|
+
b'[0,"123456789",1,1,"","user","pwd",333,"54321"]'
|
|
219
|
+
b']IEND\0',
|
|
220
|
+
b'ISTARTIEND\0'
|
|
221
|
+
])
|
|
222
|
+
async def test_net_config_apn_auth_invalid(
|
|
223
|
+
new_apn_auth_value: Optional[G90APNAuth],
|
|
224
|
+
expected_recv_data: list[bytes],
|
|
225
|
+
mock_device: DeviceMock
|
|
226
|
+
) -> None:
|
|
227
|
+
"""
|
|
228
|
+
Tests for handling network configuration with invalid APN authentication
|
|
229
|
+
method value.
|
|
230
|
+
"""
|
|
231
|
+
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
232
|
+
|
|
233
|
+
# Retrieve configuration
|
|
234
|
+
cfg = await g90.net_config()
|
|
235
|
+
assert isinstance(cfg, G90NetConfig)
|
|
236
|
+
|
|
237
|
+
# Verify retrieved value is mapped to NONE enum value
|
|
238
|
+
assert cfg.apn_auth == G90APNAuth.NONE
|
|
239
|
+
|
|
240
|
+
# Modify the value if requested
|
|
241
|
+
if new_apn_auth_value is not None:
|
|
242
|
+
cfg.apn_auth = new_apn_auth_value
|
|
243
|
+
# Save the configuration
|
|
244
|
+
await cfg.save()
|
|
245
|
+
|
|
246
|
+
# Verify data sent to the device
|
|
247
|
+
assert await mock_device.recv_data == expected_recv_data
|
|
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
|
|
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.5.2 → pyg90alarm-2.5.3}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py
RENAMED
|
File without changes
|
{pyg90alarm-2.5.2 → pyg90alarm-2.5.3}/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
|