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.

@@ -1,9 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pykoplenti
3
- Version: 1.2.0
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>=3.8-5
19
- Requires-Dist: pycryptodome>=3.6.6
20
- Requires-Dist: pydantic>=1.10
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
- ProcessDataListTypeAdapter.validate_python(data_response[0]["processdata"])
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
- ProcessDataListTypeAdapter.validate_python(data_response[0]["processdata"])
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
- ProcessDataListTypeAdapter.validate_python(data_response[0]["processdata"])
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
- ProcessDataListTypeAdapter.validate_python(x["processdata"])
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, TypeAdapter
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.0
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>=3.8-5
19
- Requires-Dist: pycryptodome>=3.6.6
20
- Requires-Dist: pydantic>=1.10
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"
@@ -0,0 +1,7 @@
1
+ aiohttp~=3.8.5
2
+ pycryptodome~=3.19
3
+ pydantic~=1.10
4
+
5
+ [CLI]
6
+ prompt_toolkit>=3.0
7
+ click>=7.1
@@ -1,12 +1,16 @@
1
1
  [metadata]
2
2
  name = pykoplenti
3
- version = 1.2.0
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 >= 3.8-5
24
- pycryptodome >= 3.6.6
25
- pydantic >= 1.10
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
- ProcessDataListTypeAdapter.validate_python(json.loads(raw_response))
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
- ProcessDataListTypeAdapter.validate_python(json.loads(raw_response))
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
- ProcessDataListTypeAdapter.validate_python(json.loads(raw_response))
161
+ parse_obj_as(list[pykoplenti.ProcessData], json.loads(raw_response))
162
162
  )
163
163
 
164
164
  result = list(pdc)
@@ -1,7 +0,0 @@
1
- aiohttp>=3.8-5
2
- pycryptodome>=3.6.6
3
- pydantic>=1.10
4
-
5
- [CLI]
6
- prompt_toolkit>=3.0
7
- click>=7.1
File without changes
File without changes
File without changes
File without changes
File without changes