Hydro-Quebec-API-Wrapper 3.1.1__tar.gz → 3.1.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.
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.gitlab-ci.yml +5 -5
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.pre-commit-config.yaml +5 -4
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/PKG-INFO +1 -1
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/requires.txt +1 -1
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/PKG-INFO +1 -1
- Hydro-Quebec-API-Wrapper-3.1.2/conflict_test_requirements.txt +1 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/examples/hydro.py +12 -10
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/setup.cfg +1 -1
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/test_requirements.txt +5 -5
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_common.py +47 -13
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_dt.py +46 -28
- Hydro-Quebec-API-Wrapper-3.1.1/conflict_test_requirements.txt +0 -1
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.coveragerc +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.flake8 +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.gitignore +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/.pylintrc +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/SOURCES.txt +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/dependency_links.txt +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/entry_points.txt +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/Hydro_Quebec_API_Wrapper.egg-info/top_level.txt +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/LICENSE +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/MANIFEST.in +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/README.md +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/config.default.yaml +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/Makefile +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/make.bat +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/_static/custom.css +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/_static/hydroqc-logo-128.png +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/_static/hydroqc-logo.svg +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/conf.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/external/description-des-codes-interruption.pdf +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/index.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.contract.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.hydro_api.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.peak.cpc.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.peak.dpc.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.peak.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.types.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/modules.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/todo.rst +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/account.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/consts.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/common.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_d.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_d_cpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_dpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_dt.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_m.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_m_gdp.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_residential.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/outage.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/customer.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/diagnostic.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/error.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/cache.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/client.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/consts.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/logger.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/consts.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/handler.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/peak.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/consts.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/handler.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/peak.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/py.typed +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/timerange.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/account.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/common.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/consump.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/contract.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/cpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/dpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/dt.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/types/outage.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/utils.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/webuser.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/logo/hydroqc-logo-128.png +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/logo/hydroqc-logo.svg +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/pyproject.toml +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/renovate.json5 +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/__init__.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/conftest.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_d.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_d_cpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_dpc.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_m.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_m_gdp.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/test_basic.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/test_timerange.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/tools.py +0 -0
- {Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tox.ini +0 -0
|
@@ -31,7 +31,7 @@ test:
|
|
|
31
31
|
stage: test
|
|
32
32
|
tags:
|
|
33
33
|
- hydroqc
|
|
34
|
-
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:
|
|
34
|
+
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:c2f84259e74c1bbd73497ee0d5a71fb5d8f8ff68befdd90f2f5e9b282da0f709
|
|
35
35
|
script:
|
|
36
36
|
- pip install tox
|
|
37
37
|
- tox -e pylint,flake8,pydocstyle,typing,black,deps-conflict --parallel auto
|
|
@@ -70,7 +70,7 @@ test:
|
|
|
70
70
|
stage: private_tests
|
|
71
71
|
tags:
|
|
72
72
|
- hydroqc
|
|
73
|
-
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:
|
|
73
|
+
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:c2f84259e74c1bbd73497ee0d5a71fb5d8f8ff68befdd90f2f5e9b282da0f709
|
|
74
74
|
script:
|
|
75
75
|
#- apt update && apt install -y jq unzip curl
|
|
76
76
|
- >
|
|
@@ -258,7 +258,7 @@ private_tests_done:
|
|
|
258
258
|
stage: private_tests_done
|
|
259
259
|
tags:
|
|
260
260
|
- hydroqc
|
|
261
|
-
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:
|
|
261
|
+
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:c2f84259e74c1bbd73497ee0d5a71fb5d8f8ff68befdd90f2f5e9b282da0f709
|
|
262
262
|
script:
|
|
263
263
|
#- apt-get update && apt-get install --no-install-recommends -y python3.10 python3-venv python3-pip --no-install-recommends git
|
|
264
264
|
- echo "Private Tests done"
|
|
@@ -301,7 +301,7 @@ package:
|
|
|
301
301
|
stage: test
|
|
302
302
|
tags:
|
|
303
303
|
- hydroqc
|
|
304
|
-
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:
|
|
304
|
+
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:c2f84259e74c1bbd73497ee0d5a71fb5d8f8ff68befdd90f2f5e9b282da0f709
|
|
305
305
|
script:
|
|
306
306
|
# Build a package with a version based on the commmit short sha
|
|
307
307
|
- pip install --upgrade pip
|
|
@@ -331,7 +331,7 @@ promote2pypi:
|
|
|
331
331
|
stage: pypi
|
|
332
332
|
tags:
|
|
333
333
|
- hydroqc
|
|
334
|
-
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:
|
|
334
|
+
image: registry.gitlab.com/hydroqc/hydroqc-base-container/3.11@sha256:c2f84259e74c1bbd73497ee0d5a71fb5d8f8ff68befdd90f2f5e9b282da0f709
|
|
335
335
|
script:
|
|
336
336
|
# TODO: try to pull the good package from gitlab pypi repo
|
|
337
337
|
# then change the version (promote)
|
|
@@ -16,7 +16,7 @@ repos:
|
|
|
16
16
|
- id: check-ast
|
|
17
17
|
|
|
18
18
|
- repo: https://github.com/psf/black
|
|
19
|
-
rev: 23.
|
|
19
|
+
rev: 23.12.0
|
|
20
20
|
hooks:
|
|
21
21
|
- id: black
|
|
22
22
|
language_version: python3
|
|
@@ -28,7 +28,7 @@ repos:
|
|
|
28
28
|
additional_dependencies: [flake8-docstrings]
|
|
29
29
|
|
|
30
30
|
- repo: https://github.com/PyCQA/isort
|
|
31
|
-
rev: 5.
|
|
31
|
+
rev: 5.13.2
|
|
32
32
|
hooks:
|
|
33
33
|
- id: isort
|
|
34
34
|
args: ["--profile", "black", "--filter-files"]
|
|
@@ -40,7 +40,7 @@ repos:
|
|
|
40
40
|
- id: doc8
|
|
41
41
|
|
|
42
42
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
43
|
-
rev: v1.
|
|
43
|
+
rev: v1.7.1
|
|
44
44
|
hooks:
|
|
45
45
|
- id: mypy
|
|
46
46
|
args: [--strict, --pretty, --show-error-codes]
|
|
@@ -49,5 +49,6 @@ repos:
|
|
|
49
49
|
- "types-PyYAML==6.0.12.12"
|
|
50
50
|
- "types-python-dateutil==2.8.19.14"
|
|
51
51
|
- "pytest-stub==1.1.0"
|
|
52
|
-
- "aiohttp==3.
|
|
52
|
+
- "aiohttp==3.9.1"
|
|
53
53
|
- "aiocache==0.12.2"
|
|
54
|
+
- "pkce==1.0.3"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mqtt-hass-base==4.2.5
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
import asyncio
|
|
3
3
|
import os
|
|
4
|
+
from datetime import date
|
|
4
5
|
|
|
5
6
|
from hydroqc.webuser import WebUser
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
USERNAME = os.getenv("hydroQcUsername")
|
|
8
10
|
PASSWORD = os.getenv("hydroQcPassword")
|
|
9
11
|
|
|
@@ -32,28 +34,28 @@ async def async_func():
|
|
|
32
34
|
print(data)
|
|
33
35
|
|
|
34
36
|
# Can still access events but probably unnecessary
|
|
35
|
-
await contract.
|
|
36
|
-
data = contract.
|
|
37
|
+
await contract.peak_handler.refresh_data()
|
|
38
|
+
data = contract.peak_handler.next_anchor
|
|
37
39
|
print(data)
|
|
38
|
-
data = contract.
|
|
40
|
+
data = contract.peak_handler.next_peak
|
|
39
41
|
print(data)
|
|
40
|
-
data = contract.
|
|
42
|
+
data = contract.peak_handler.next_peak_is_critical
|
|
41
43
|
print(data)
|
|
42
|
-
data = contract.
|
|
44
|
+
data = contract.peak_handler.cumulated_credit
|
|
43
45
|
print(data)
|
|
44
46
|
|
|
45
47
|
# Need to call refresh_data before accessing attributes
|
|
46
|
-
await contract.
|
|
47
|
-
wc = contract.
|
|
48
|
+
await contract.peak_handler.refresh_data()
|
|
49
|
+
wc = contract.peak_handler.__dict__
|
|
48
50
|
for k in wc.keys():
|
|
49
51
|
if not k.startswith("value_"):
|
|
50
52
|
continue
|
|
51
53
|
else:
|
|
52
54
|
print(k + " : " + str(wc[k]))
|
|
53
55
|
# Still accessible through the data property
|
|
54
|
-
data = contract.
|
|
56
|
+
data = contract.peak_handler.raw_data
|
|
55
57
|
print(data)
|
|
56
|
-
data = await contract.get_hourly_consumption("2022-01-20")
|
|
58
|
+
data = await contract.get_hourly_consumption(date.fromisoformat("2022-01-20"))
|
|
57
59
|
print(data)
|
|
58
60
|
data = await contract.get_today_hourly_consumption()
|
|
59
61
|
print(data)
|
|
@@ -63,7 +65,7 @@ async def async_func():
|
|
|
63
65
|
print(data)
|
|
64
66
|
data = await contract.get_annual_consumption()
|
|
65
67
|
print(data)
|
|
66
|
-
data = await contract.get_daily_consumption("2022-01-10", "2022-01-20")
|
|
68
|
+
data = await contract.get_daily_consumption(date.fromisoformat("2022-01-10"), date.fromisoformat("2022-01-20"))
|
|
67
69
|
print(data)
|
|
68
70
|
|
|
69
71
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
flake8==6.1.0
|
|
2
2
|
pydocstyle==6.3.0
|
|
3
3
|
parameterized==0.9.0
|
|
4
|
-
pylint==3.0.
|
|
4
|
+
pylint==3.0.3
|
|
5
5
|
pytest==7.4.3
|
|
6
6
|
pytest-cov==4.1.0
|
|
7
|
-
pytest-asyncio==0.
|
|
8
|
-
black==23.
|
|
9
|
-
mypy==1.
|
|
7
|
+
pytest-asyncio==0.23.2
|
|
8
|
+
black==23.12.0
|
|
9
|
+
mypy==1.7.1
|
|
10
10
|
types-pytz==2023.3.1.1
|
|
11
11
|
types-PyYAML==6.0.12.12
|
|
12
12
|
types-python-dateutil==2.8.19.14
|
|
13
|
-
pyright==1.1.
|
|
13
|
+
pyright==1.1.341
|
|
14
14
|
lxml==4.9.3
|
|
@@ -15,7 +15,7 @@ from hydroqc.contract.common import (
|
|
|
15
15
|
)
|
|
16
16
|
from hydroqc.contract.contract_dpc import check_dpc_data_present
|
|
17
17
|
from hydroqc.customer import Customer
|
|
18
|
-
from hydroqc.error import HydroQcError
|
|
18
|
+
from hydroqc.error import HydroQcError, HydroQcHTTPError
|
|
19
19
|
from hydroqc.peak.cpc.handler import CPCPeakHandler
|
|
20
20
|
from hydroqc.webuser import WebUser
|
|
21
21
|
|
|
@@ -255,12 +255,35 @@ class SubTestCommon:
|
|
|
255
255
|
@pytest.mark.asyncio
|
|
256
256
|
async def test_hourly_consumption(self, contract: Contract) -> None:
|
|
257
257
|
"""Test hourly consumption stats."""
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
258
|
+
try:
|
|
259
|
+
today_hourly_consumption = await contract.get_today_hourly_consumption()
|
|
260
|
+
assert today_hourly_consumption.get("success") is True
|
|
261
|
+
assert today_hourly_consumption.get("results", {}).get("dateJour") in (
|
|
262
|
+
today_str,
|
|
263
|
+
yesterday_str,
|
|
264
|
+
)
|
|
265
|
+
except HydroQcHTTPError as exp:
|
|
266
|
+
# Failing at the end of the period
|
|
267
|
+
# So we are check if it's the case
|
|
268
|
+
# If not, it's an actual issue
|
|
269
|
+
await contract.get_periods_info()
|
|
270
|
+
if (
|
|
271
|
+
isinstance(contract.cp_current_day, int)
|
|
272
|
+
and isinstance(contract.cp_duration, int)
|
|
273
|
+
and (
|
|
274
|
+
contract.cp_current_day < 2
|
|
275
|
+
or contract.cp_duration - contract.cp_current_day < 2
|
|
276
|
+
)
|
|
277
|
+
):
|
|
278
|
+
# end of period or new period detected
|
|
279
|
+
assert (
|
|
280
|
+
True
|
|
281
|
+
), "End of period or new period detected: no hourly consumption"
|
|
282
|
+
else:
|
|
283
|
+
assert (
|
|
284
|
+
False
|
|
285
|
+
), "NO End of period or new period detected: error in no hourly consumption"
|
|
286
|
+
raise exp
|
|
264
287
|
|
|
265
288
|
@pytest.mark.asyncio
|
|
266
289
|
async def test_total_hourly_consumption(self, contract: Contract) -> None:
|
|
@@ -338,12 +361,23 @@ class SubTestCommon:
|
|
|
338
361
|
@pytest.mark.asyncio
|
|
339
362
|
async def test_latest_period(self, contract: Contract) -> None:
|
|
340
363
|
"""Test latest_period."""
|
|
341
|
-
|
|
342
|
-
contract.cp_current_day
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
364
|
+
if (
|
|
365
|
+
isinstance(contract.cp_current_day, int)
|
|
366
|
+
and isinstance(contract.cp_duration, int)
|
|
367
|
+
and (
|
|
368
|
+
contract.cp_current_day < 2
|
|
369
|
+
or contract.cp_duration - contract.cp_current_day < 2
|
|
370
|
+
)
|
|
371
|
+
):
|
|
372
|
+
assert contract.cp_current_day is not None
|
|
373
|
+
assert contract.latest_period_info
|
|
374
|
+
else:
|
|
375
|
+
assert (
|
|
376
|
+
contract.cp_current_day is None
|
|
377
|
+
), "Method get_period_info is already called but it should not"
|
|
378
|
+
assert (
|
|
379
|
+
not contract.latest_period_info
|
|
380
|
+
), "Method get_period_info is already called but it should not"
|
|
347
381
|
|
|
348
382
|
@typing.no_type_check
|
|
349
383
|
@pytest.mark.asyncio
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_dt.py
RENAMED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"""Contract DT tests module."""
|
|
2
|
+
from types import NoneType
|
|
3
|
+
|
|
2
4
|
import pytest
|
|
3
5
|
|
|
4
6
|
from hydroqc.contract import ContractDT
|
|
@@ -16,35 +18,51 @@ class SubTestContractDT:
|
|
|
16
18
|
assert contract.rate == "DT"
|
|
17
19
|
assert contract.rate_option == ""
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
isinstance(contract.
|
|
21
|
-
and contract.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
isinstance(contract.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
isinstance(contract.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
if (
|
|
22
|
+
isinstance(contract.cp_current_day, int)
|
|
23
|
+
and isinstance(contract.cp_duration, int)
|
|
24
|
+
and (
|
|
25
|
+
contract.cp_current_day < 2
|
|
26
|
+
or contract.cp_duration - contract.cp_current_day < 2
|
|
27
|
+
)
|
|
28
|
+
):
|
|
29
|
+
assert isinstance(contract.cp_current_bill, (float, NoneType))
|
|
30
|
+
assert isinstance(contract.cp_projected_bill, (float, NoneType))
|
|
31
|
+
assert isinstance(contract.cp_daily_bill_mean, (float, NoneType))
|
|
32
|
+
assert isinstance(contract.cp_projected_total_consumption, (int, NoneType))
|
|
33
|
+
assert isinstance(contract.cp_kwh_cost_mean, (float, NoneType))
|
|
34
|
+
assert isinstance(contract.cp_lower_price_consumption, (int, NoneType))
|
|
35
|
+
assert isinstance(contract.cp_higher_price_consumption, (int, NoneType))
|
|
36
|
+
else:
|
|
37
|
+
assert (
|
|
38
|
+
isinstance(contract.cp_current_bill, float)
|
|
39
|
+
and contract.cp_current_bill >= 0
|
|
40
|
+
)
|
|
41
|
+
assert (
|
|
42
|
+
isinstance(contract.cp_projected_bill, float)
|
|
43
|
+
and contract.cp_projected_bill >= 0
|
|
44
|
+
)
|
|
45
|
+
assert (
|
|
46
|
+
isinstance(contract.cp_daily_bill_mean, float)
|
|
47
|
+
and contract.cp_daily_bill_mean >= 0
|
|
48
|
+
)
|
|
49
|
+
assert (
|
|
50
|
+
isinstance(contract.cp_projected_total_consumption, int)
|
|
51
|
+
and contract.cp_projected_total_consumption >= 0
|
|
52
|
+
)
|
|
53
|
+
assert (
|
|
54
|
+
isinstance(contract.cp_kwh_cost_mean, float)
|
|
55
|
+
and contract.cp_kwh_cost_mean >= 0
|
|
56
|
+
)
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
assert (
|
|
59
|
+
isinstance(contract.cp_lower_price_consumption, int)
|
|
60
|
+
and contract.cp_lower_price_consumption >= 0
|
|
61
|
+
)
|
|
62
|
+
assert (
|
|
63
|
+
isinstance(contract.cp_higher_price_consumption, int)
|
|
64
|
+
and contract.cp_higher_price_consumption >= 0
|
|
65
|
+
)
|
|
48
66
|
|
|
49
67
|
assert isinstance(contract.amount_saved_vs_base_rate, float)
|
|
50
68
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
mqtt-hass-base==4.2.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/_static/custom.css
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
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/hydroqc.rst
RENAMED
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/docs/source/reference/modules.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/__init__.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/common.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_d.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_d_cpc.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_dpc.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_dt.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_m.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/contract_m_gdp.py
RENAMED
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/contract/outage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/__init__.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/cache.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/client.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/hydro_api/consts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/__init__.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/consts.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/cpc/handler.py
RENAMED
|
File without changes
|
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/__init__.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/consts.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/hydroqc/peak/dpc/handler.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
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_d.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_d_cpc.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_dpc.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_m.py
RENAMED
|
File without changes
|
{Hydro-Quebec-API-Wrapper-3.1.1 → Hydro-Quebec-API-Wrapper-3.1.2}/tests/subtest_contract_m_gdp.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|