nwp500-python 7.2.1__tar.gz → 7.2.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.
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/CHANGELOG.rst +13 -0
- {nwp500_python-7.2.1/src/nwp500_python.egg-info → nwp500_python-7.2.2}/PKG-INFO +1 -1
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/quick_reference.rst +3 -1
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/models.py +1 -1
- {nwp500_python-7.2.1 → nwp500_python-7.2.2/src/nwp500_python.egg-info}/PKG-INFO +1 -1
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_model_converters.py +33 -2
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.agent/workflows/pre-completion-testing.md +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.coveragerc +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/copilot-instructions.md +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/workflows/ci.yml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/workflows/release.yml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.gitignore +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.pre-commit-config.yaml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.readthedocs.yml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/AUTHORS.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/CONTRIBUTING.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/LICENSE.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/Makefile +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/README.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/RELEASE.md +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/Makefile +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/_static/.gitignore +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/api/nwp500.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/authors.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/changelog.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/conf.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/configuration.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/development/contributing.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/development/history.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/enumerations.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/advanced_features_explained.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/authentication.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/auto_recovery.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/command_queue.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/energy_monitoring.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/event_system.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/mqtt_diagnostics.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/reservations.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/scheduling_features.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/time_of_use.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/index.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/installation.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/license.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/openapi.yaml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/data_conversions.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/device_features.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/device_status.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/error_codes.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/mqtt_protocol.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/rest_api.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/api_client.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/auth_client.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/cli.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/device_control.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/events.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/exceptions.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/models.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/mqtt_client.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/quickstart.rst +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/requirements.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/.ruff.toml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/README.md +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/air_filter_reset.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/anti_legionella.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/auto_recovery.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/combined_callbacks.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/demand_response.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/device_capabilities.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/device_status_debug.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/energy_analytics.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/error_code_demo.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/mqtt_diagnostics.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/power_control.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/recirculation_control.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/reconnection_demo.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/reservation_schedule.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/simple_auto_recovery.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/token_restoration.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/tou_openei.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/tou_schedule.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/water_reservation.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/01_authentication.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/02_list_devices.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/03_get_status.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/04_set_temperature.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/advanced_auth_patterns.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/command_queue.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/device_status_callback.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/error_handling.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/event_driven_control.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/improved_auth.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/legacy_auth_constructor.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/mqtt_realtime_monitoring.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/periodic_requests.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/set_mode.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/vacation_mode.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/mask.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/periodic_device_info.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/simple_periodic_info.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_api_client.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_mqtt_connection.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_mqtt_messaging.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_periodic_minimal.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/pyproject.toml +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/README.md +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/bump_version.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/diagnose_mqtt_connection.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/extract_changelog.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/format.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/lint.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/setup-dev.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/validate_version.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/setup.cfg +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/setup.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/__init__.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/api_client.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/auth.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/__init__.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/__main__.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/commands.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/handlers.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/monitoring.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/output_formatters.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/rich_output.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/token_storage.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/command_decorators.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/config.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/converters.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/device_capabilities.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/device_info_cache.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/encoding.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/enums.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/events.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/exceptions.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/factory.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/field_factory.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/__init__.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/client.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/command_queue.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/connection.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/control.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/diagnostics.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/periodic.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/reconnection.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/subscriptions.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/utils.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt_events.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/py.typed +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/temperature.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/topic_builder.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/utils.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/SOURCES.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/dependency_links.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/entry_points.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/not-zip-safe +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/requires.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/top_level.txt +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/conftest.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_api_helpers.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_auth.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_cli_basic.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_cli_commands.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_command_decorators.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_command_queue.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_device_capabilities.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_device_info_cache.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_events.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_exceptions.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_models.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_mqtt_client_init.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_temperature_converters.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_utils.py +0 -0
- {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tox.ini +0 -0
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
Changelog
|
|
3
3
|
=========
|
|
4
4
|
|
|
5
|
+
Version 7.2.2 (2025-12-25)
|
|
6
|
+
==========================
|
|
7
|
+
|
|
8
|
+
Fixed
|
|
9
|
+
-----
|
|
10
|
+
- **TOU Status Always Showing False**: Fixed ``touStatus`` field always reporting ``False`` regardless of actual device state
|
|
11
|
+
|
|
12
|
+
- Root cause: Version 7.2.1 incorrectly changed ``touStatus`` to use device-specific 1/2 encoding, but the device uses standard 0/1 encoding
|
|
13
|
+
- Solution: Use Python's built-in ``bool()`` for ``touStatus`` field (handles 0=False, 1=True naturally)
|
|
14
|
+
- Updated documentation in ``docs/protocol/quick_reference.rst`` to note ``touStatus`` exception
|
|
15
|
+
- Added tests verifying built-in ``bool()`` handles 0/1 encoding correctly
|
|
16
|
+
- Device encoding: 0=OFF/disabled, 1=ON/enabled (standard Python truthiness)
|
|
17
|
+
|
|
5
18
|
Version 7.2.1 (2025-12-25)
|
|
6
19
|
==========================
|
|
7
20
|
|
|
@@ -19,11 +19,13 @@ The device uses non-standard boolean encoding in many status fields:
|
|
|
19
19
|
- Notes
|
|
20
20
|
* - **1**
|
|
21
21
|
- OFF / False
|
|
22
|
-
- Standard: False value. Used for power
|
|
22
|
+
- Standard: False value. Used for power and most feature flags.
|
|
23
23
|
* - **2**
|
|
24
24
|
- ON / True
|
|
25
25
|
- Standard: True value.
|
|
26
26
|
|
|
27
|
+
**Exception:** The ``touStatus`` field uses 0/1 encoding (0=disabled, 1=enabled) instead of the standard 1/2 encoding.
|
|
28
|
+
|
|
27
29
|
**Why 1 & 2?**
|
|
28
30
|
This likely stems from legacy firmware design where:
|
|
29
31
|
|
|
@@ -56,7 +56,7 @@ CapabilityFlag = Annotated[bool, BeforeValidator(device_bool_to_python)]
|
|
|
56
56
|
Div10 = Annotated[float, BeforeValidator(div_10)]
|
|
57
57
|
HalfCelsiusToF = Annotated[float, BeforeValidator(half_celsius_to_fahrenheit)]
|
|
58
58
|
DeciCelsiusToF = Annotated[float, BeforeValidator(deci_celsius_to_fahrenheit)]
|
|
59
|
-
TouStatus = Annotated[bool, BeforeValidator(
|
|
59
|
+
TouStatus = Annotated[bool, BeforeValidator(bool)]
|
|
60
60
|
TouOverride = Annotated[bool, BeforeValidator(tou_override_to_python)]
|
|
61
61
|
VolumeCodeField = Annotated[
|
|
62
62
|
VolumeCode, BeforeValidator(enum_validator(VolumeCode))
|
|
@@ -6,8 +6,7 @@ Tests cover:
|
|
|
6
6
|
- div_10 (divide by 10 converter)
|
|
7
7
|
- enum_validator (enum validation and conversion)
|
|
8
8
|
|
|
9
|
-
Note:
|
|
10
|
-
(same as all other OnOffFlag fields)
|
|
9
|
+
Note: touStatus field uses built-in bool() for standard 0/1 encoding
|
|
11
10
|
"""
|
|
12
11
|
|
|
13
12
|
import pytest
|
|
@@ -91,6 +90,38 @@ class TestDeviceBoolConverter:
|
|
|
91
90
|
assert device_bool_to_python(off_value) is False
|
|
92
91
|
|
|
93
92
|
|
|
93
|
+
class TestBuiltinBoolForTouStatus:
|
|
94
|
+
"""Test built-in bool() for TOU status field (0/1 encoding).
|
|
95
|
+
|
|
96
|
+
The touStatus field uses standard 0/1 encoding, so Python's built-in
|
|
97
|
+
bool() is sufficient - no custom converter needed.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
def test_enabled_state(self):
|
|
101
|
+
"""TOU enabled: 1 = True."""
|
|
102
|
+
assert bool(1) is True
|
|
103
|
+
|
|
104
|
+
def test_disabled_state(self):
|
|
105
|
+
"""TOU disabled: 0 = False."""
|
|
106
|
+
assert bool(0) is False
|
|
107
|
+
|
|
108
|
+
def test_nonzero_is_true(self):
|
|
109
|
+
"""Any non-zero value is truthy."""
|
|
110
|
+
assert bool(2) is True
|
|
111
|
+
assert bool(99) is True
|
|
112
|
+
assert bool(-1) is True
|
|
113
|
+
|
|
114
|
+
@pytest.mark.parametrize("value", [0, 0.0, "", [], {}, None])
|
|
115
|
+
def test_falsy_values(self, value):
|
|
116
|
+
"""Test various falsy values."""
|
|
117
|
+
assert bool(value) is False
|
|
118
|
+
|
|
119
|
+
@pytest.mark.parametrize("value", [1, 2, -1, "text", [1], {1: 1}])
|
|
120
|
+
def test_truthy_values(self, value):
|
|
121
|
+
"""Test various truthy values."""
|
|
122
|
+
assert bool(value) is True
|
|
123
|
+
|
|
124
|
+
|
|
94
125
|
class TestTouOverrideConverter:
|
|
95
126
|
"""Test tou_override_to_python converter.
|
|
96
127
|
|
|
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
|
{nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/legacy_auth_constructor.py
RENAMED
|
File without changes
|
{nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/mqtt_realtime_monitoring.py
RENAMED
|
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
|