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.
Files changed (173) hide show
  1. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/CHANGELOG.rst +13 -0
  2. {nwp500_python-7.2.1/src/nwp500_python.egg-info → nwp500_python-7.2.2}/PKG-INFO +1 -1
  3. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/quick_reference.rst +3 -1
  4. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/models.py +1 -1
  5. {nwp500_python-7.2.1 → nwp500_python-7.2.2/src/nwp500_python.egg-info}/PKG-INFO +1 -1
  6. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_model_converters.py +33 -2
  7. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.agent/workflows/pre-completion-testing.md +0 -0
  8. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.coveragerc +0 -0
  9. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/copilot-instructions.md +0 -0
  10. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/workflows/ci.yml +0 -0
  11. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.github/workflows/release.yml +0 -0
  12. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.gitignore +0 -0
  13. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.pre-commit-config.yaml +0 -0
  14. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/.readthedocs.yml +0 -0
  15. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/AUTHORS.rst +0 -0
  16. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/CONTRIBUTING.rst +0 -0
  17. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/LICENSE.txt +0 -0
  18. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/Makefile +0 -0
  19. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/README.rst +0 -0
  20. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/RELEASE.md +0 -0
  21. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/Makefile +0 -0
  22. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/_static/.gitignore +0 -0
  23. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/api/nwp500.rst +0 -0
  24. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/authors.rst +0 -0
  25. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/changelog.rst +0 -0
  26. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/conf.py +0 -0
  27. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/configuration.rst +0 -0
  28. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/development/contributing.rst +0 -0
  29. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/development/history.rst +0 -0
  30. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/enumerations.rst +0 -0
  31. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/advanced_features_explained.rst +0 -0
  32. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/authentication.rst +0 -0
  33. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/auto_recovery.rst +0 -0
  34. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/command_queue.rst +0 -0
  35. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/energy_monitoring.rst +0 -0
  36. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/event_system.rst +0 -0
  37. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/mqtt_diagnostics.rst +0 -0
  38. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/reservations.rst +0 -0
  39. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/scheduling_features.rst +0 -0
  40. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/guides/time_of_use.rst +0 -0
  41. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/index.rst +0 -0
  42. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/installation.rst +0 -0
  43. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/license.rst +0 -0
  44. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/openapi.yaml +0 -0
  45. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/data_conversions.rst +0 -0
  46. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/device_features.rst +0 -0
  47. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/device_status.rst +0 -0
  48. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/error_codes.rst +0 -0
  49. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/mqtt_protocol.rst +0 -0
  50. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/protocol/rest_api.rst +0 -0
  51. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/api_client.rst +0 -0
  52. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/auth_client.rst +0 -0
  53. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/cli.rst +0 -0
  54. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/device_control.rst +0 -0
  55. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/events.rst +0 -0
  56. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/exceptions.rst +0 -0
  57. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/models.rst +0 -0
  58. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/python_api/mqtt_client.rst +0 -0
  59. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/quickstart.rst +0 -0
  60. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/docs/requirements.txt +0 -0
  61. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/.ruff.toml +0 -0
  62. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/README.md +0 -0
  63. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/air_filter_reset.py +0 -0
  64. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/anti_legionella.py +0 -0
  65. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/auto_recovery.py +0 -0
  66. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/combined_callbacks.py +0 -0
  67. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/demand_response.py +0 -0
  68. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/device_capabilities.py +0 -0
  69. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/device_status_debug.py +0 -0
  70. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/energy_analytics.py +0 -0
  71. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/error_code_demo.py +0 -0
  72. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/mqtt_diagnostics.py +0 -0
  73. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/power_control.py +0 -0
  74. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/recirculation_control.py +0 -0
  75. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/reconnection_demo.py +0 -0
  76. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/reservation_schedule.py +0 -0
  77. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/simple_auto_recovery.py +0 -0
  78. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/token_restoration.py +0 -0
  79. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/tou_openei.py +0 -0
  80. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/tou_schedule.py +0 -0
  81. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/advanced/water_reservation.py +0 -0
  82. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/01_authentication.py +0 -0
  83. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/02_list_devices.py +0 -0
  84. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/03_get_status.py +0 -0
  85. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/beginner/04_set_temperature.py +0 -0
  86. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/advanced_auth_patterns.py +0 -0
  87. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/command_queue.py +0 -0
  88. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/device_status_callback.py +0 -0
  89. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/error_handling.py +0 -0
  90. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/event_driven_control.py +0 -0
  91. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/improved_auth.py +0 -0
  92. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/legacy_auth_constructor.py +0 -0
  93. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/mqtt_realtime_monitoring.py +0 -0
  94. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/periodic_requests.py +0 -0
  95. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/set_mode.py +0 -0
  96. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/intermediate/vacation_mode.py +0 -0
  97. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/mask.py +0 -0
  98. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/periodic_device_info.py +0 -0
  99. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/simple_periodic_info.py +0 -0
  100. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_api_client.py +0 -0
  101. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_mqtt_connection.py +0 -0
  102. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_mqtt_messaging.py +0 -0
  103. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/examples/testing/test_periodic_minimal.py +0 -0
  104. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/pyproject.toml +0 -0
  105. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/README.md +0 -0
  106. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/bump_version.py +0 -0
  107. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/diagnose_mqtt_connection.py +0 -0
  108. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/extract_changelog.py +0 -0
  109. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/format.py +0 -0
  110. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/lint.py +0 -0
  111. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/setup-dev.py +0 -0
  112. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/scripts/validate_version.py +0 -0
  113. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/setup.cfg +0 -0
  114. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/setup.py +0 -0
  115. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/__init__.py +0 -0
  116. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/api_client.py +0 -0
  117. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/auth.py +0 -0
  118. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/__init__.py +0 -0
  119. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/__main__.py +0 -0
  120. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/commands.py +0 -0
  121. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/handlers.py +0 -0
  122. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/monitoring.py +0 -0
  123. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/output_formatters.py +0 -0
  124. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/rich_output.py +0 -0
  125. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/cli/token_storage.py +0 -0
  126. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/command_decorators.py +0 -0
  127. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/config.py +0 -0
  128. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/converters.py +0 -0
  129. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/device_capabilities.py +0 -0
  130. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/device_info_cache.py +0 -0
  131. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/encoding.py +0 -0
  132. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/enums.py +0 -0
  133. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/events.py +0 -0
  134. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/exceptions.py +0 -0
  135. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/factory.py +0 -0
  136. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/field_factory.py +0 -0
  137. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/__init__.py +0 -0
  138. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/client.py +0 -0
  139. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/command_queue.py +0 -0
  140. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/connection.py +0 -0
  141. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/control.py +0 -0
  142. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/diagnostics.py +0 -0
  143. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/periodic.py +0 -0
  144. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/reconnection.py +0 -0
  145. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/subscriptions.py +0 -0
  146. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt/utils.py +0 -0
  147. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/mqtt_events.py +0 -0
  148. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/py.typed +0 -0
  149. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/temperature.py +0 -0
  150. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/topic_builder.py +0 -0
  151. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500/utils.py +0 -0
  152. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/SOURCES.txt +0 -0
  153. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/dependency_links.txt +0 -0
  154. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/entry_points.txt +0 -0
  155. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/not-zip-safe +0 -0
  156. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/requires.txt +0 -0
  157. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/src/nwp500_python.egg-info/top_level.txt +0 -0
  158. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/conftest.py +0 -0
  159. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_api_helpers.py +0 -0
  160. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_auth.py +0 -0
  161. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_cli_basic.py +0 -0
  162. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_cli_commands.py +0 -0
  163. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_command_decorators.py +0 -0
  164. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_command_queue.py +0 -0
  165. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_device_capabilities.py +0 -0
  166. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_device_info_cache.py +0 -0
  167. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_events.py +0 -0
  168. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_exceptions.py +0 -0
  169. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_models.py +0 -0
  170. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_mqtt_client_init.py +0 -0
  171. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_temperature_converters.py +0 -0
  172. {nwp500_python-7.2.1 → nwp500_python-7.2.2}/tests/test_utils.py +0 -0
  173. {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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nwp500-python
3
- Version: 7.2.1
3
+ Version: 7.2.2
4
4
  Summary: A library for controlling Navien NWP500 Water Heaters via NaviLink
5
5
  Home-page: https://github.com/eman/nwp500-python
6
6
  Author: Emmanuel Levijarvi
@@ -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, TOU status, and most feature flags.
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(device_bool_to_python)]
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))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nwp500-python
3
- Version: 7.2.1
3
+ Version: 7.2.2
4
4
  Summary: A library for controlling Navien NWP500 Water Heaters via NaviLink
5
5
  Home-page: https://github.com/eman/nwp500-python
6
6
  Author: Emmanuel Levijarvi
@@ -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: tou_status field uses device_bool_to_python
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