python-homewizard-energy 8.0.0b3__tar.gz → 8.1.0__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 (15) hide show
  1. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/PKG-INFO +1 -1
  2. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/errors.py +7 -0
  3. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/v2/__init__.py +11 -2
  4. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/pyproject.toml +1 -1
  5. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/LICENSE +0 -0
  6. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/README.md +0 -0
  7. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/__init__.py +0 -0
  8. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/const.py +0 -0
  9. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/homewizard_energy.py +0 -0
  10. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/models.py +0 -0
  11. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/py.typed +0 -0
  12. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/v1/__init__.py +0 -0
  13. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/v1/const.py +0 -0
  14. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/v2/cacert.py +0 -0
  15. {python_homewizard_energy-8.0.0b3 → python_homewizard_energy-8.1.0}/homewizard_energy/v2/const.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-homewizard-energy
3
- Version: 8.0.0b3
3
+ Version: 8.1.0
4
4
  Summary: Asynchronous Python client for the HomeWizard Energy
5
5
  Home-page: https://github.com/homewizard/python-homewizard-energy
6
6
  License: Apache-2.0
@@ -12,6 +12,13 @@ class RequestError(HomeWizardEnergyException):
12
12
  """
13
13
 
14
14
 
15
+ class InvalidUserNameError(HomeWizardEnergyException):
16
+ """Invalid username.
17
+
18
+ Raised when username is not valid, too short or too long.
19
+ """
20
+
21
+
15
22
  class ResponseError(HomeWizardEnergyException):
16
23
  """API responded unexpected."""
17
24
 
@@ -16,7 +16,13 @@ from aiohttp.hdrs import METH_DELETE, METH_GET, METH_POST, METH_PUT
16
16
  from mashumaro.exceptions import InvalidFieldValue, MissingField
17
17
 
18
18
  from ..const import LOGGER
19
- from ..errors import DisabledError, RequestError, ResponseError, UnauthorizedError
19
+ from ..errors import (
20
+ DisabledError,
21
+ InvalidUserNameError,
22
+ RequestError,
23
+ ResponseError,
24
+ UnauthorizedError,
25
+ )
20
26
  from ..homewizard_energy import HomeWizardEnergy
21
27
  from ..models import Device, Measurement, System, SystemUpdate, Token
22
28
  from .cacert import CACERT
@@ -158,7 +164,9 @@ class HomeWizardEnergyV2(HomeWizardEnergy):
158
164
 
159
165
  if status != HTTPStatus.OK:
160
166
  error = json.loads(response).get("error", response)
161
- raise RequestError(f"Error occurred while getting token: {error}", error)
167
+ raise InvalidUserNameError(
168
+ f"Error occurred while getting token: {error}", error
169
+ )
162
170
 
163
171
  try:
164
172
  token = Token.from_json(response).token
@@ -195,6 +203,7 @@ class HomeWizardEnergyV2(HomeWizardEnergy):
195
203
 
196
204
  def _build_ssl_context() -> ssl.SSLContext:
197
205
  context = ssl.create_default_context(cadata=CACERT)
206
+ context.verify_flags = ssl.VERIFY_X509_PARTIAL_CHAIN # pylint: disable=no-member
198
207
  if self._identifier is not None:
199
208
  context.hostname_checks_common_name = True
200
209
  else:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-homewizard-energy"
3
- version = "8.0.0-beta-3"
3
+ version = "8.1.0"
4
4
  description = "Asynchronous Python client for the HomeWizard Energy"
5
5
  authors = ["DCSBL"]
6
6
  maintainers = ["DCSBL"]