pyg90alarm 2.5.1__tar.gz → 2.5.2__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.1 → pyg90alarm-2.5.2}/PKG-INFO +1 -1
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/host_config.py +1 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/net_config.py +1 -1
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm.egg-info/PKG-INFO +1 -1
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_host_config.py +32 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_net_config.py +40 -1
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.github/CODEOWNERS +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.github/dependabot.yml +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.github/workflows/main.yml +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.gitignore +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.pylintrc +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/.readthedocs.yaml +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/LICENSE +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/MANIFEST.in +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/README.rst +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/.DS_Store +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/.gitignore +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/api-docs.rst +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/cloud-protocol.rst +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/conf.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/index.rst +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/local-protocol.rst +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/docs/requirements.txt +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/pyproject.toml +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/setup.cfg +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/setup.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/sonar-project.properties +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/alarm.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/callback.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/cloud/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/cloud/const.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/cloud/messages.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/cloud/notifications.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/cloud/protocol.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/const.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/dataclass/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/dataclass/load_save.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/dataclass/validation.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/definitions/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/definitions/base.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/definitions/devices.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/definitions/sensors.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/base_entity.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/base_list.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/device.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/device_list.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/sensor.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/entities/sensor_list.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/event_mapping.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/exceptions.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/alarm_phones.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/alert_config.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/base_cmd.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/config.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/discovery.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/history.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/host_info.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/host_status.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/notifications.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/paginated_cmd.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/paginated_result.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/targeted_discovery.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/local/user_data_crc.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/notifications/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/notifications/base.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/notifications/protocol.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm/py.typed +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm.egg-info/SOURCES.txt +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm.egg-info/dependency_links.txt +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm.egg-info/requires.txt +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/src/pyg90alarm.egg-info/top_level.txt +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/__init__.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/conftest.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/device_mock.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_alarm.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_alarm_phones.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_base_commands.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_cloud_notifications.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_config.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_devices.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_discovery.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_history.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_local_notifications.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_paginated_commands.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/test_sensor.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/dataclass/test_dataclass_load_save.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/dataclass/test_dataclass_load_save_serialize.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/dataclass/test_validation.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/entities/test_base_list.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tests/unit/test_exceptions.py +0 -0
- {pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/tox.ini +0 -0
|
@@ -73,7 +73,7 @@ class G90NetConfig(DataclassLoadSave):
|
|
|
73
73
|
# Access Point Name (APN) for GPRS connection, as provided by the cellular
|
|
74
74
|
# operator
|
|
75
75
|
apn_name: str = validated_string_field(
|
|
76
|
-
min_length=
|
|
76
|
+
min_length=0, max_length=100, trust_initial_value=True
|
|
77
77
|
)
|
|
78
78
|
# User name for APN authentication, as provided by the cellular operator
|
|
79
79
|
apn_user: str = validated_string_field(
|
|
@@ -164,3 +164,35 @@ async def test_host_config_constraints(
|
|
|
164
164
|
# Test setting valid value
|
|
165
165
|
setattr(cfg, field_name, valid_value)
|
|
166
166
|
assert getattr(cfg, field_name) == valid_value
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
@pytest.mark.g90device(sent_data=[
|
|
170
|
+
b'ISTART[106,'
|
|
171
|
+
b'[900,0,0,1,2,2,60,0,0,60,2]'
|
|
172
|
+
b']IEND\0',
|
|
173
|
+
b'ISTARTIEND\0'
|
|
174
|
+
])
|
|
175
|
+
async def test_host_config_speech_language_zero(
|
|
176
|
+
mock_device: DeviceMock
|
|
177
|
+
) -> None:
|
|
178
|
+
"""
|
|
179
|
+
Tests for handling host configuration with speech language set to zero.
|
|
180
|
+
"""
|
|
181
|
+
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
182
|
+
|
|
183
|
+
# Retrieve configuration
|
|
184
|
+
cfg = await g90.host_config()
|
|
185
|
+
assert isinstance(cfg, G90HostConfig)
|
|
186
|
+
|
|
187
|
+
# Verify retrieved values
|
|
188
|
+
assert cfg.speech_language == G90SpeechLanguage.NONE
|
|
189
|
+
|
|
190
|
+
# Verify zero value is allowed to be sent back to the panel
|
|
191
|
+
await cfg.save()
|
|
192
|
+
|
|
193
|
+
assert await mock_device.recv_data == [
|
|
194
|
+
b'ISTART[106,106,""]IEND\0',
|
|
195
|
+
b'ISTART[107,107,[107,'
|
|
196
|
+
b'[900,0,0,1,2,2,60,0,0,60,2]'
|
|
197
|
+
b']]IEND\0'
|
|
198
|
+
]
|
|
@@ -80,7 +80,7 @@ async def test_net_config(
|
|
|
80
80
|
@pytest.mark.parametrize(
|
|
81
81
|
'field_name,invalid_value_low,invalid_value_high,valid_value', [
|
|
82
82
|
pytest.param(
|
|
83
|
-
'apn_name',
|
|
83
|
+
'apn_name', None, 'a' * 101, 'valid.apn.net',
|
|
84
84
|
id='apn_name'
|
|
85
85
|
),
|
|
86
86
|
pytest.param(
|
|
@@ -151,3 +151,42 @@ async def test_net_config_constraints(
|
|
|
151
151
|
# Test setting valid value
|
|
152
152
|
setattr(cfg, field_name, valid_value)
|
|
153
153
|
assert getattr(cfg, field_name) == valid_value
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@pytest.mark.g90device(sent_data=[
|
|
157
|
+
b'ISTART[212,'
|
|
158
|
+
b'[0,"123456789",1,1,"","user","pwd",3,"54321"]'
|
|
159
|
+
b']IEND\0',
|
|
160
|
+
b'ISTARTIEND\0'
|
|
161
|
+
])
|
|
162
|
+
async def test_net_config_apn_name_empty(
|
|
163
|
+
mock_device: DeviceMock, caplog: pytest.LogCaptureFixture
|
|
164
|
+
) -> None:
|
|
165
|
+
"""
|
|
166
|
+
Tests for handling network configuration with empty APN name.
|
|
167
|
+
"""
|
|
168
|
+
g90 = G90Alarm(host=mock_device.host, port=mock_device.port)
|
|
169
|
+
|
|
170
|
+
# Retrieve configuration
|
|
171
|
+
cfg = await g90.net_config()
|
|
172
|
+
assert isinstance(cfg, G90NetConfig)
|
|
173
|
+
|
|
174
|
+
# Verify retrieved values
|
|
175
|
+
assert cfg.apn_name == ''
|
|
176
|
+
|
|
177
|
+
# Ensure that no validation error was logged for empty APN name, the value
|
|
178
|
+
# of the field as received from the panel is trusted, so no exception will
|
|
179
|
+
# be raised only error logged
|
|
180
|
+
assert (
|
|
181
|
+
'apn_name: Validation failed during initialization for trusted value'
|
|
182
|
+
) not in ''.join(caplog.messages)
|
|
183
|
+
|
|
184
|
+
# Verify empty APN name is allowed to be sent back to the panel
|
|
185
|
+
await cfg.save()
|
|
186
|
+
|
|
187
|
+
assert await mock_device.recv_data == [
|
|
188
|
+
b'ISTART[212,212,""]IEND\0',
|
|
189
|
+
b'ISTART[213,213,[213,'
|
|
190
|
+
b'[0,"123456789",1,1,"","user","pwd",3]'
|
|
191
|
+
b']]IEND\0'
|
|
192
|
+
]
|
|
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.1 → pyg90alarm-2.5.2}/tests/unit/dataclass/test_dataclass_load_save_descriptor.py
RENAMED
|
File without changes
|
{pyg90alarm-2.5.1 → pyg90alarm-2.5.2}/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
|