pykoplenti 1.2.0__tar.gz → 1.2.1__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.
Potentially problematic release.
This version of pykoplenti might be problematic. Click here for more details.
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/PKG-INFO +7 -4
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/api.py +6 -5
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/model.py +1 -2
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti.egg-info/PKG-INFO +7 -4
- pykoplenti-1.2.1/pykoplenti.egg-info/requires.txt +7 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/setup.cfg +8 -4
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/tests/test_pykoplenti.py +4 -4
- pykoplenti-1.2.0/pykoplenti.egg-info/requires.txt +0 -7
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/LICENSE +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/README.md +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/__init__.py +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/cli.py +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/extended.py +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti/py.typed +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti.egg-info/SOURCES.txt +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti.egg-info/dependency_links.txt +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti.egg-info/entry_points.txt +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pykoplenti.egg-info/top_level.txt +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/pyproject.toml +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/setup.py +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/tests/test_extendedapiclient.py +0 -0
- {pykoplenti-1.2.0 → pykoplenti-1.2.1}/tests/test_smoketest.py +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pykoplenti
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Python REST-Client for Kostal Plenticore Solar Inverters
|
|
5
5
|
Home-page: https://github.com/stegm/pyclient_koplenti
|
|
6
6
|
Author: @stegm
|
|
7
|
+
Project-URL: repository, https://github.com/stegm/pyclient_koplenti
|
|
8
|
+
Project-URL: changelog, https://github.com/stegm/pykoplenti/blob/master/CHANGELOG.md
|
|
9
|
+
Project-URL: issues, https://github.com/stegm/pykoplenti/issues
|
|
7
10
|
Keywords: rest kostal plenticore solar
|
|
8
11
|
Classifier: Development Status :: 4 - Beta
|
|
9
12
|
Classifier: Environment :: Console
|
|
@@ -15,9 +18,9 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
15
18
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
19
|
Description-Content-Type: text/markdown
|
|
17
20
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: aiohttp
|
|
19
|
-
Requires-Dist: pycryptodome
|
|
20
|
-
Requires-Dist: pydantic
|
|
21
|
+
Requires-Dist: aiohttp~=3.8.5
|
|
22
|
+
Requires-Dist: pycryptodome~=3.19
|
|
23
|
+
Requires-Dist: pydantic~=1.10
|
|
21
24
|
Provides-Extra: cli
|
|
22
25
|
Requires-Dist: prompt_toolkit>=3.0; extra == "cli"
|
|
23
26
|
Requires-Dist: click>=7.1; extra == "cli"
|
|
@@ -13,14 +13,15 @@ import warnings
|
|
|
13
13
|
|
|
14
14
|
from Crypto.Cipher import AES
|
|
15
15
|
from aiohttp import ClientResponse, ClientSession, ClientTimeout
|
|
16
|
+
from pydantic import parse_obj_as
|
|
16
17
|
from yarl import URL
|
|
17
18
|
|
|
18
19
|
from .model import (
|
|
19
20
|
EventData,
|
|
20
21
|
MeData,
|
|
21
22
|
ModuleData,
|
|
23
|
+
ProcessData,
|
|
22
24
|
ProcessDataCollection,
|
|
23
|
-
ProcessDataListTypeAdapter,
|
|
24
25
|
SettingsData,
|
|
25
26
|
VersionData,
|
|
26
27
|
)
|
|
@@ -522,7 +523,7 @@ class ApiClient(contextlib.AbstractAsyncContextManager):
|
|
|
522
523
|
data_response = await resp.json()
|
|
523
524
|
return {
|
|
524
525
|
data_response[0]["moduleid"]: ProcessDataCollection(
|
|
525
|
-
|
|
526
|
+
parse_obj_as(list[ProcessData], data_response[0]["processdata"])
|
|
526
527
|
)
|
|
527
528
|
}
|
|
528
529
|
|
|
@@ -535,7 +536,7 @@ class ApiClient(contextlib.AbstractAsyncContextManager):
|
|
|
535
536
|
data_response = await resp.json()
|
|
536
537
|
return {
|
|
537
538
|
data_response[0]["moduleid"]: ProcessDataCollection(
|
|
538
|
-
|
|
539
|
+
parse_obj_as(list[ProcessData], data_response[0]["processdata"])
|
|
539
540
|
)
|
|
540
541
|
}
|
|
541
542
|
|
|
@@ -551,7 +552,7 @@ class ApiClient(contextlib.AbstractAsyncContextManager):
|
|
|
551
552
|
data_response = await resp.json()
|
|
552
553
|
return {
|
|
553
554
|
data_response[0]["moduleid"]: ProcessDataCollection(
|
|
554
|
-
|
|
555
|
+
parse_obj_as(list[ProcessData], data_response[0]["processdata"])
|
|
555
556
|
)
|
|
556
557
|
}
|
|
557
558
|
|
|
@@ -573,7 +574,7 @@ class ApiClient(contextlib.AbstractAsyncContextManager):
|
|
|
573
574
|
data_response = await resp.json()
|
|
574
575
|
return {
|
|
575
576
|
x["moduleid"]: ProcessDataCollection(
|
|
576
|
-
|
|
577
|
+
parse_obj_as(List[ProcessData], x["processdata"])
|
|
577
578
|
)
|
|
578
579
|
for x in data_response
|
|
579
580
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from typing import Iterator, Mapping
|
|
3
3
|
|
|
4
|
-
from pydantic import BaseModel, Field
|
|
4
|
+
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class MeData(BaseModel):
|
|
@@ -38,7 +38,6 @@ class ProcessData(BaseModel):
|
|
|
38
38
|
unit: str
|
|
39
39
|
value: float
|
|
40
40
|
|
|
41
|
-
ProcessDataListTypeAdapter = TypeAdapter(list[ProcessData])
|
|
42
41
|
|
|
43
42
|
class ProcessDataCollection(Mapping):
|
|
44
43
|
"""Represents a collection of process data value."""
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pykoplenti
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Python REST-Client for Kostal Plenticore Solar Inverters
|
|
5
5
|
Home-page: https://github.com/stegm/pyclient_koplenti
|
|
6
6
|
Author: @stegm
|
|
7
|
+
Project-URL: repository, https://github.com/stegm/pyclient_koplenti
|
|
8
|
+
Project-URL: changelog, https://github.com/stegm/pykoplenti/blob/master/CHANGELOG.md
|
|
9
|
+
Project-URL: issues, https://github.com/stegm/pykoplenti/issues
|
|
7
10
|
Keywords: rest kostal plenticore solar
|
|
8
11
|
Classifier: Development Status :: 4 - Beta
|
|
9
12
|
Classifier: Environment :: Console
|
|
@@ -15,9 +18,9 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
15
18
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
19
|
Description-Content-Type: text/markdown
|
|
17
20
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: aiohttp
|
|
19
|
-
Requires-Dist: pycryptodome
|
|
20
|
-
Requires-Dist: pydantic
|
|
21
|
+
Requires-Dist: aiohttp~=3.8.5
|
|
22
|
+
Requires-Dist: pycryptodome~=3.19
|
|
23
|
+
Requires-Dist: pydantic~=1.10
|
|
21
24
|
Provides-Extra: cli
|
|
22
25
|
Requires-Dist: prompt_toolkit>=3.0; extra == "cli"
|
|
23
26
|
Requires-Dist: click>=7.1; extra == "cli"
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = pykoplenti
|
|
3
|
-
version = 1.2.
|
|
3
|
+
version = 1.2.1
|
|
4
4
|
description = Python REST-Client for Kostal Plenticore Solar Inverters
|
|
5
5
|
long_description = file: README.md
|
|
6
6
|
long_description_content_type = text/markdown
|
|
7
7
|
keywords = rest kostal plenticore solar
|
|
8
8
|
author = @stegm
|
|
9
9
|
url = https://github.com/stegm/pyclient_koplenti
|
|
10
|
+
project_urls =
|
|
11
|
+
repository = https://github.com/stegm/pyclient_koplenti
|
|
12
|
+
changelog = https://github.com/stegm/pykoplenti/blob/master/CHANGELOG.md
|
|
13
|
+
issues = https://github.com/stegm/pykoplenti/issues
|
|
10
14
|
classifiers =
|
|
11
15
|
Development Status :: 4 - Beta
|
|
12
16
|
Environment :: Console
|
|
@@ -20,9 +24,9 @@ classifiers =
|
|
|
20
24
|
[options]
|
|
21
25
|
packages = pykoplenti
|
|
22
26
|
install_requires =
|
|
23
|
-
aiohttp
|
|
24
|
-
pycryptodome
|
|
25
|
-
pydantic
|
|
27
|
+
aiohttp ~= 3.8.5
|
|
28
|
+
pycryptodome ~= 3.19
|
|
29
|
+
pydantic ~= 1.10
|
|
26
30
|
|
|
27
31
|
[options.package_data]
|
|
28
32
|
pykoplenti = py.typed
|
|
@@ -3,10 +3,10 @@ import json
|
|
|
3
3
|
from typing import Any, Callable
|
|
4
4
|
from unittest.mock import ANY, MagicMock
|
|
5
5
|
|
|
6
|
+
from pydantic import parse_obj_as
|
|
6
7
|
import pytest
|
|
7
8
|
|
|
8
9
|
import pykoplenti
|
|
9
|
-
from pykoplenti.model import ProcessDataListTypeAdapter
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def test_me_parsing():
|
|
@@ -129,7 +129,7 @@ def test_process_data_collection_indicates_length():
|
|
|
129
129
|
'{"id": "Statistic:Yield:Month", "unit": "", "value": 2}]'
|
|
130
130
|
)
|
|
131
131
|
pdc = pykoplenti.ProcessDataCollection(
|
|
132
|
-
|
|
132
|
+
parse_obj_as(list[pykoplenti.ProcessData], json.loads(raw_response))
|
|
133
133
|
)
|
|
134
134
|
|
|
135
135
|
assert len(pdc) == 2
|
|
@@ -141,7 +141,7 @@ def test_process_data_collection_index_returns_processdata():
|
|
|
141
141
|
'{"id": "Statistic:Yield:Month", "unit": "", "value": 2}]'
|
|
142
142
|
)
|
|
143
143
|
pdc = pykoplenti.ProcessDataCollection(
|
|
144
|
-
|
|
144
|
+
parse_obj_as(list[pykoplenti.ProcessData], json.loads(raw_response))
|
|
145
145
|
)
|
|
146
146
|
|
|
147
147
|
result = pdc["Statistic:Yield:Month"]
|
|
@@ -158,7 +158,7 @@ def test_process_data_collection_can_be_iterated():
|
|
|
158
158
|
'{"id": "Statistic:Yield:Month", "unit": "", "value": 2}]'
|
|
159
159
|
)
|
|
160
160
|
pdc = pykoplenti.ProcessDataCollection(
|
|
161
|
-
|
|
161
|
+
parse_obj_as(list[pykoplenti.ProcessData], json.loads(raw_response))
|
|
162
162
|
)
|
|
163
163
|
|
|
164
164
|
result = list(pdc)
|
|
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
|