myPyllant 0.7.0__tar.gz → 0.7.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 (103) hide show
  1. {mypyllant-0.7.0 → mypyllant-0.7.2}/.pre-commit-config.yaml +23 -25
  2. {mypyllant-0.7.0 → mypyllant-0.7.2}/PKG-INFO +1 -1
  3. {mypyllant-0.7.0 → mypyllant-0.7.2}/dev-requirements.txt +4 -1
  4. {mypyllant-0.7.0 → mypyllant-0.7.2}/pyproject.toml +6 -6
  5. mypyllant-0.7.2/run_venv.sh +9 -0
  6. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/api.py +2 -1
  7. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/models.py +38 -11
  8. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/generate_test_data.py +10 -8
  9. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/run_function_test.py +17 -14
  10. mypyllant-0.7.0/run_pytest.sh +0 -9
  11. {mypyllant-0.7.0 → mypyllant-0.7.2}/.devcontainer.json +0 -0
  12. {mypyllant-0.7.0 → mypyllant-0.7.2}/.dockerignore +0 -0
  13. {mypyllant-0.7.0 → mypyllant-0.7.2}/.github/dependabot.yml +0 -0
  14. {mypyllant-0.7.0 → mypyllant-0.7.2}/.github/workflows/build-test.yaml +0 -0
  15. {mypyllant-0.7.0 → mypyllant-0.7.2}/.github/workflows/docker.yaml +0 -0
  16. {mypyllant-0.7.0 → mypyllant-0.7.2}/.gitignore +0 -0
  17. {mypyllant-0.7.0 → mypyllant-0.7.2}/.vscode/settings.json +0 -0
  18. {mypyllant-0.7.0 → mypyllant-0.7.2}/.vscode/tasks.json +0 -0
  19. {mypyllant-0.7.0 → mypyllant-0.7.2}/Dockerfile +0 -0
  20. {mypyllant-0.7.0 → mypyllant-0.7.2}/LICENSE +0 -0
  21. {mypyllant-0.7.0 → mypyllant-0.7.2}/README.md +0 -0
  22. {mypyllant-0.7.0 → mypyllant-0.7.2}/logo.png +0 -0
  23. {mypyllant-0.7.0 → mypyllant-0.7.2}/scripts/precommit +0 -0
  24. {mypyllant-0.7.0 → mypyllant-0.7.2}/scripts/setup +0 -0
  25. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/__init__.py +0 -0
  26. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/const.py +0 -0
  27. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/export.py +0 -0
  28. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/py.typed +0 -0
  29. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/report.py +0 -0
  30. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/sample.py +0 -0
  31. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/__init__.py +0 -0
  32. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/conftest.py +0 -0
  33. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/find_countries.py +0 -0
  34. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/connection_status.json +0 -0
  35. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/control_identifier.json +0 -0
  36. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/current_system.json +0 -0
  37. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/device_buckets.json +0 -0
  38. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/diagnostic_trouble_codes.json +0 -0
  39. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/mpc.json +0 -0
  40. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/system.json +0 -0
  41. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/335e4ac949f68855c761a15671e5da393cf96ffe/time_zone.json +0 -0
  42. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/heatpump_electric_backup/homes.json +0 -0
  43. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/connection_status.json +0 -0
  44. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/control_identifier.json +0 -0
  45. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/current_system.json +0 -0
  46. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/device_buckets.json +0 -0
  47. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/firmware_update_required.json +0 -0
  48. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/system.json +0 -0
  49. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/1835c08766437e41a9c69bdf454e0ec8bfb0e82f/time_zone.json +0 -0
  50. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/no_system/homes.json +0 -0
  51. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/connection_status.json +0 -0
  52. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/control_identifier.json +0 -0
  53. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/current_system.json +0 -0
  54. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/device_buckets.json +0 -0
  55. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/diagnostic_trouble_codes.json +0 -0
  56. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/mpc.json +0 -0
  57. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/system.json +0 -0
  58. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/7571042b8af21b829bda040425f77a76706b03d7/time_zone.json +0 -0
  59. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/one_system_two_heatpumps/homes.json +0 -0
  60. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/connection_status.json +0 -0
  61. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/control_identifier.json +0 -0
  62. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/current_system.json +0 -0
  63. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/device_buckets.json +0 -0
  64. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/diagnostic_trouble_codes.json +0 -0
  65. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/mpc.json +0 -0
  66. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/system.json +0 -0
  67. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/e763593de7370e8d6f90fea50daacd9883e2e532/time_zone.json +0 -0
  68. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/connection_status.json +0 -0
  69. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/control_identifier.json +0 -0
  70. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/current_system.json +0 -0
  71. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/device_buckets.json +0 -0
  72. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/diagnostic_trouble_codes.json +0 -0
  73. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/mpc.json +0 -0
  74. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/system.json +0 -0
  75. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/eed6a6500c47dc8f433846e845bb662e13fe469e/time_zone.json +0 -0
  76. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/two_systems/homes.json +0 -0
  77. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/connection_status.json +0 -0
  78. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/control_identifier.json +0 -0
  79. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/current_system.json +0 -0
  80. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/device_buckets.json +0 -0
  81. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/diagnostic_trouble_codes.json +0 -0
  82. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/system.json +0 -0
  83. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/8fa4fe154d541e83ee01c807c0c85e29fc8c02ae/time_zone.json +0 -0
  84. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/ventilation/homes.json +0 -0
  85. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/connection_status.json +0 -0
  86. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/control_identifier.json +0 -0
  87. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/current_system.json +0 -0
  88. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/device_buckets.json +0 -0
  89. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/diagnostic_trouble_codes.json +0 -0
  90. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/mpc.json +0 -0
  91. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/system.json +0 -0
  92. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/214ff1c13404bfd2d9350da3bfe86d45b9a7d670/time_zone.json +0 -0
  93. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/json/vrc700/homes.json +0 -0
  94. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_api.py +0 -0
  95. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_countries.py +0 -0
  96. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_export.py +0 -0
  97. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_generate_test_data.py +0 -0
  98. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_models.py +0 -0
  99. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_sample.py +0 -0
  100. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/test_utils.py +0 -0
  101. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/update_sample.py +0 -0
  102. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/tests/utils.py +0 -0
  103. {mypyllant-0.7.0 → mypyllant-0.7.2}/src/myPyllant/utils.py +0 -0
@@ -13,30 +13,12 @@ repos:
13
13
  - --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing
14
14
  - --skip="./.*,*.csv,*.json"
15
15
  - --quiet-level=2
16
- exclude_types: [csv, json]
16
+ exclude_types: [ csv, json ]
17
17
  - repo: https://github.com/pre-commit/pre-commit-hooks
18
18
  rev: v4.4.0
19
19
  hooks:
20
20
  - id: check-executables-have-shebangs
21
21
  - id: check-json
22
- - repo: https://github.com/pre-commit/mirrors-mypy
23
- rev: v1.0.1
24
- hooks:
25
- - id: mypy
26
- args:
27
- - --pretty
28
- - --show-error-codes
29
- - --show-error-context
30
- additional_dependencies:
31
- - aiohttp
32
- - aioresponses
33
- - dacite
34
- - exceptiongroup
35
- - freezegun
36
- - pytest
37
- - tomli
38
- - types-requests
39
- - types-python-dateutil
40
22
  - repo: local
41
23
  hooks:
42
24
  - id: update-sample
@@ -46,9 +28,25 @@ repos:
46
28
  pass_filenames: false
47
29
  - repo: local
48
30
  hooks:
49
- - id: pytest
50
- name: pytest
51
- entry: run_pytest.sh -n4 --no-cov
52
- language: script
53
- pass_filenames: false
54
- files: ^src/.+\.(py|json|yaml)$
31
+ - id: mypy
32
+ name: mypy
33
+ entry: run_venv.sh
34
+ args:
35
+ - mypy
36
+ - --pretty
37
+ - --show-error-codes
38
+ - --show-error-context
39
+ - --check-untyped-defs
40
+ language: script
41
+ pass_filenames: true
42
+ files: ^src/.+\.py$
43
+ - id: pytest
44
+ name: pytest
45
+ entry: run_venv.sh
46
+ args:
47
+ - pytest
48
+ - --no-cov
49
+ - -n4
50
+ language: script
51
+ pass_filenames: false
52
+ files: ^src/.+\.(py|json|yaml)$
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myPyllant
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: A Python library to interact with the API behind the myVAILLANT app
5
5
  Project-URL: Homepage, https://github.com/signalkraft/myPyllant
6
6
  Project-URL: Bug Tracker, https://github.com/signalkraft/myPyllant/issues
@@ -4,6 +4,7 @@ aiohttp>=3.8.0
4
4
  pytest-aiohttp~=1.0.5
5
5
  pytest-cov~=4.1.0
6
6
  pytest-mock~=3.12.0
7
+ pytest-xdist>=3.3.0
7
8
  pre-commit~=3.6.0
8
9
  build~=1.0.3
9
10
  freezegun~=1.4.0
@@ -11,4 +12,6 @@ country_list~=1.1.0
11
12
  requests~=2.31.0
12
13
  dacite>=1.7.0
13
14
  python-dateutil>=2.8.0
14
- types-PyYAML~=6.0.12.12
15
+ mypy~=1.8.0
16
+ types-python-dateutil~=2.8.19.14
17
+ types-requests~=2.31.0.20231231
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "myPyllant"
3
3
  authors = [
4
- { name="Philipp", email="pd@signalkraft.com" },
4
+ { name = "Philipp", email = "pd@signalkraft.com" },
5
5
  ]
6
6
  description = "A Python library to interact with the API behind the myVAILLANT app"
7
7
  readme = "README.md"
@@ -12,9 +12,9 @@ classifiers = [
12
12
  "Operating System :: OS Independent",
13
13
  ]
14
14
  dependencies = [
15
- "aiohttp>=3.8.0",
16
- "dacite>=1.7.0",
17
- "python-dateutil>=2.8.0",
15
+ "aiohttp>=3.8.0",
16
+ "dacite>=1.7.0",
17
+ "python-dateutil>=2.8.0",
18
18
  ]
19
19
  dynamic = ["version"]
20
20
 
@@ -31,9 +31,9 @@ source = "vcs"
31
31
 
32
32
  [tool.pytest.ini_options]
33
33
  pythonpath = [
34
- "src"
34
+ "src"
35
35
  ]
36
- addopts = "--cov=src"
36
+ addopts = "-n4 --cov=src"
37
37
  asyncio_mode = "auto"
38
38
  testpaths = [
39
39
  "src/myPyllant/tests",
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+
3
+ # Run command in .venv if found, otherwise fll back to globally installed (for Github actions)
4
+ CMD=".venv/bin/$1"
5
+ if [ -f "$CMD" ]; then
6
+ $CMD "${@:2}"
7
+ else
8
+ "$1" "${@:2}"
9
+ fi
@@ -210,7 +210,7 @@ class MyPyllantAPI:
210
210
  + r"\?([^\"]*)",
211
211
  login_html,
212
212
  )
213
- login_url = unescape(result.group())
213
+ login_url = unescape(result.group()) if result else None
214
214
  if not login_url:
215
215
  raise AuthenticationFailed("Could not get login URL")
216
216
 
@@ -370,6 +370,7 @@ class MyPyllantAPI:
370
370
  brand=self.brand,
371
371
  home=home,
372
372
  timezone=home.timezone,
373
+ control_identifier=await self.get_control_identifier(home.system_id),
373
374
  connected=await self.get_connection_status(home.system_id)
374
375
  if include_connection_status
375
376
  else None,
@@ -6,7 +6,7 @@ import logging
6
6
  from collections.abc import Iterator
7
7
  from dataclasses import dataclass, field, asdict
8
8
  from enum import Enum, EnumMeta
9
- from typing import TypeVar
9
+ from typing import TypeVar, Any
10
10
 
11
11
  from dacite import Config, from_dict
12
12
  from dacite.dataclasses import get_fields
@@ -108,7 +108,7 @@ class MyPyllantDataClass:
108
108
  Base class that runs type validation in __init__ and can create an instance from API values
109
109
  """
110
110
 
111
- extra_fields: dict = field(default_factory=dict)
111
+ extra_fields: dict[str, Any] = field(default_factory=dict)
112
112
 
113
113
  @classmethod
114
114
  def type_hooks(cls: type[T], timezone: datetime.tzinfo | None) -> dict:
@@ -210,13 +210,13 @@ class BaseTimeProgramDay(MyPyllantDataClass):
210
210
 
211
211
  @dataclass
212
212
  class BaseTimeProgram(MyPyllantDataClass):
213
- monday: list[BaseTimeProgramDay]
214
- tuesday: list[BaseTimeProgramDay]
215
- wednesday: list[BaseTimeProgramDay]
216
- thursday: list[BaseTimeProgramDay]
217
- friday: list[BaseTimeProgramDay]
218
- saturday: list[BaseTimeProgramDay]
219
- sunday: list[BaseTimeProgramDay]
213
+ monday: list
214
+ tuesday: list
215
+ wednesday: list
216
+ thursday: list
217
+ friday: list
218
+ saturday: list
219
+ sunday: list
220
220
  meta_info: dict | None = None
221
221
 
222
222
  @property
@@ -308,6 +308,14 @@ class ZoneTimeProgramDay(BaseTimeProgramDay):
308
308
 
309
309
  @dataclass
310
310
  class ZoneTimeProgram(BaseTimeProgram):
311
+ monday: list[ZoneTimeProgramDay]
312
+ tuesday: list[ZoneTimeProgramDay]
313
+ wednesday: list[ZoneTimeProgramDay]
314
+ thursday: list[ZoneTimeProgramDay]
315
+ friday: list[ZoneTimeProgramDay]
316
+ saturday: list[ZoneTimeProgramDay]
317
+ sunday: list[ZoneTimeProgramDay]
318
+
311
319
  @classmethod
312
320
  def create_day_from_api(cls, **kwargs):
313
321
  return ZoneTimeProgramDay(**kwargs)
@@ -321,7 +329,7 @@ class ZoneTimeProgram(BaseTimeProgram):
321
329
  weekday_names = [w.lower() for w in calendar.day_name]
322
330
  if update_similar_to_dow and update_similar_to_dow not in weekday_names:
323
331
  raise ValueError(
324
- "%s is not a valid weekday, sue one of %s or None",
332
+ "%s is not a valid weekday, use one of %s or None",
325
333
  update_similar_to_dow,
326
334
  ", ".join(weekday_names),
327
335
  )
@@ -409,6 +417,7 @@ class Zone(MyPyllantDataClass):
409
417
  system_id: str
410
418
  general: ZoneGeneral
411
419
  timezone: datetime.tzinfo
420
+ control_identifier: str
412
421
  index: int
413
422
  zone_binding: str
414
423
  heating: ZoneHeating
@@ -459,6 +468,10 @@ class Zone(MyPyllantDataClass):
459
468
  else None
460
469
  )
461
470
 
471
+ @property
472
+ def is_eco_mode(self) -> bool:
473
+ return self.desired_room_temperature_setpoint == 0.0
474
+
462
475
 
463
476
  @dataclass
464
477
  class Circuit(MyPyllantDataClass):
@@ -490,6 +503,14 @@ class DHWTimeProgramDay(BaseTimeProgramDay):
490
503
 
491
504
  @dataclass
492
505
  class DHWTimeProgram(BaseTimeProgram):
506
+ monday: list[DHWTimeProgramDay]
507
+ tuesday: list[DHWTimeProgramDay]
508
+ wednesday: list[DHWTimeProgramDay]
509
+ thursday: list[DHWTimeProgramDay]
510
+ friday: list[DHWTimeProgramDay]
511
+ saturday: list[DHWTimeProgramDay]
512
+ sunday: list[DHWTimeProgramDay]
513
+
493
514
  @classmethod
494
515
  def create_day_from_api(cls, **kwargs):
495
516
  return DHWTimeProgramDay(**kwargs)
@@ -538,6 +559,7 @@ class System(MyPyllantDataClass):
538
559
  home: Home
539
560
  brand: str
540
561
  timezone: datetime.tzinfo
562
+ control_identifier: str
541
563
  connected: bool | None = None
542
564
  diagnostic_trouble_codes: list | None = None
543
565
  current_system: dict = field(default_factory=dict)
@@ -556,7 +578,12 @@ class System(MyPyllantDataClass):
556
578
  logger.debug(f"Creating related models from state: {kwargs}")
557
579
  system.extra_fields = system.merge_extra_fields()
558
580
  system.zones = [
559
- Zone.from_api(system_id=system.id, timezone=system.timezone, **z)
581
+ Zone.from_api(
582
+ system_id=system.id,
583
+ timezone=system.timezone,
584
+ control_identifier=system.control_identifier,
585
+ **z,
586
+ )
560
587
  for z in system.merge_object("zones")
561
588
  ]
562
589
  system.circuits = [
@@ -8,6 +8,8 @@ import json
8
8
  import logging
9
9
  import secrets
10
10
  import signal
11
+ from typing import Any, TypeVar
12
+
11
13
  import sys
12
14
  from datetime import datetime, timedelta
13
15
  from pathlib import Path
@@ -61,7 +63,7 @@ async def main(user, password, brand, country=None, write_results=True):
61
63
  from myPyllant.models import DeviceDataBucketResolution
62
64
  from myPyllant.utils import datetime_format
63
65
 
64
- results = {}
66
+ results: dict[str, Any] = {}
65
67
  json_dir = user_json_dir(user)
66
68
  if write_results:
67
69
  json_dir.mkdir(parents=True, exist_ok=True)
@@ -88,10 +90,9 @@ async def main(user, password, brand, country=None, write_results=True):
88
90
  ) as homes_resp:
89
91
  homes = await homes_resp.json()
90
92
  anonymized_homes = _recursive_data_anonymize(copy.deepcopy(homes), SALT)
91
- for system in anonymized_homes:
92
- if "address" in system:
93
- system.pop("address")
94
-
93
+ for home in anonymized_homes:
94
+ if "address" in home:
95
+ home.pop("address")
95
96
  create_result(
96
97
  anonymized_homes,
97
98
  name="homes",
@@ -270,9 +271,10 @@ async def main(user, password, brand, country=None, write_results=True):
270
271
  return results
271
272
 
272
273
 
273
- def _recursive_data_anonymize(
274
- data: str | dict | list, salt: bytes = b""
275
- ) -> str | dict | list:
274
+ T = TypeVar("T")
275
+
276
+
277
+ def _recursive_data_anonymize(data: T, salt: bytes = b"") -> T:
276
278
  if isinstance(data, list):
277
279
  for elem in data:
278
280
  _recursive_data_anonymize(elem, salt)
@@ -38,11 +38,12 @@ async def main(user, password, brand, country):
38
38
  zone, zone.heating.set_back_temperature
39
39
  )
40
40
  )
41
- print(
42
- await api.set_manual_mode_setpoint(
43
- zone, zone.heating.manual_mode_setpoint_heating
41
+ if zone.heating.manual_mode_setpoint_heating:
42
+ print(
43
+ await api.set_manual_mode_setpoint(
44
+ zone, zone.heating.manual_mode_setpoint_heating
45
+ )
44
46
  )
45
- )
46
47
  print(
47
48
  await api.set_zone_heating_operating_mode(
48
49
  zone, zone.heating.operation_mode_heating
@@ -55,13 +56,14 @@ async def main(user, password, brand, country):
55
56
  zone, "heating", zone.heating.time_program_heating
56
57
  )
57
58
  )
58
- print(
59
- await api.set_time_program_temperature(
60
- zone,
61
- "heating",
62
- zone.heating.time_program_heating.monday[0].setpoint,
59
+ if zone.heating.time_program_heating.monday[0].setpoint:
60
+ print(
61
+ await api.set_time_program_temperature(
62
+ zone,
63
+ "heating",
64
+ zone.heating.time_program_heating.monday[0].setpoint,
65
+ )
63
66
  )
64
- )
65
67
 
66
68
  if system.domestic_hot_water:
67
69
  dhw = system.domestic_hot_water[0]
@@ -72,11 +74,12 @@ async def main(user, password, brand, country):
72
74
  )
73
75
  print(await api.boost_domestic_hot_water(dhw))
74
76
  print(await api.cancel_hot_water_boost(dhw))
75
- print(
76
- await api.set_domestic_hot_water_temperature(
77
- dhw, int(dhw.tapping_setpoint)
77
+ if dhw.tapping_setpoint:
78
+ print(
79
+ await api.set_domestic_hot_water_temperature(
80
+ dhw, int(dhw.tapping_setpoint)
81
+ )
78
82
  )
79
- )
80
83
  print(
81
84
  await api.set_domestic_hot_water_time_program(
82
85
  dhw, dhw.time_program_dhw
@@ -1,9 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Run pytest in .venv if found, otherwise fll back to globally installed (for Github actions)
4
- PYTEST=.venv/bin/pytest
5
- if [ -f "$PYTEST" ]; then
6
- $PYTEST "$@"
7
- else
8
- pytest "$@"
9
- fi
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes