daybetter-services-python 1.0.6__tar.gz → 1.0.7__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 (16) hide show
  1. {daybetter_services_python-1.0.6/daybetter_services_python.egg-info → daybetter_services_python-1.0.7}/PKG-INFO +2 -1
  2. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_python/__init__.py +1 -1
  3. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_python/client.py +8 -3
  4. daybetter_services_python-1.0.7/daybetter_python/exceptions.py +38 -0
  5. daybetter_services_python-1.0.7/daybetter_python/py.typed +0 -0
  6. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7/daybetter_services_python.egg-info}/PKG-INFO +2 -1
  7. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_services_python.egg-info/SOURCES.txt +1 -0
  8. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/pyproject.toml +5 -1
  9. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/setup.py +5 -1
  10. daybetter_services_python-1.0.6/daybetter_python/exceptions.py +0 -13
  11. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/LICENSE +0 -0
  12. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/README.md +0 -0
  13. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_services_python.egg-info/dependency_links.txt +0 -0
  14. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_services_python.egg-info/requires.txt +0 -0
  15. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/daybetter_services_python.egg-info/top_level.txt +0 -0
  16. {daybetter_services_python-1.0.6 → daybetter_services_python-1.0.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daybetter-services-python
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Python client for DayBetter devices and services
5
5
  Home-page: https://github.com/THDayBetter/daybetter-python
6
6
  Author: THDayBetter
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.9
21
21
  Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Typing :: Typed
24
25
  Requires-Python: >=3.8
25
26
  Description-Content-Type: text/markdown
26
27
  License-File: LICENSE
@@ -3,5 +3,5 @@
3
3
  from .client import DayBetterClient
4
4
  from .exceptions import DayBetterError, AuthenticationError, APIError
5
5
 
6
- __version__ = "1.0.6"
6
+ __version__ = "1.0.7"
7
7
  __all__ = ["DayBetterClient", "DayBetterError", "AuthenticationError", "APIError"]
@@ -2,7 +2,7 @@
2
2
 
3
3
  import aiohttp
4
4
  import logging
5
- from typing import Any, Dict, List, Optional, Tuple
5
+ from typing import Any, Dict, List, Optional, Tuple, Type
6
6
 
7
7
  from .exceptions import DayBetterError, AuthenticationError, APIError
8
8
 
@@ -56,7 +56,12 @@ class DayBetterClient:
56
56
  self._session = aiohttp.ClientSession()
57
57
  return self
58
58
 
59
- async def __aexit__(self, exc_type, exc_val, exc_tb):
59
+ async def __aexit__(
60
+ self,
61
+ exc_type: Optional[Type[BaseException]],
62
+ exc_val: Optional[BaseException],
63
+ exc_tb: Optional[Any],
64
+ ) -> None:
60
65
  """Async context manager exit."""
61
66
  if self._session:
62
67
  await self._session.close()
@@ -454,7 +459,7 @@ class DayBetterClient:
454
459
  _LOGGER.debug("Fetched %d sensor devices", len(merged))
455
460
  return merged
456
461
 
457
- async def close(self):
462
+ async def close(self) -> None:
458
463
  """Close the client session."""
459
464
  if self._session:
460
465
  await self._session.close()
@@ -0,0 +1,38 @@
1
+ """DayBetter client exceptions."""
2
+
3
+
4
+ class DayBetterError(Exception):
5
+ """Base exception for DayBetter client."""
6
+
7
+ def __init__(self, message: str) -> None:
8
+ """Initialize the exception.
9
+
10
+ Args:
11
+ message: Error message
12
+ """
13
+ super().__init__(message)
14
+ self.message = message
15
+
16
+
17
+ class AuthenticationError(DayBetterError):
18
+ """Authentication failed."""
19
+
20
+ def __init__(self, message: str = "Authentication failed") -> None:
21
+ """Initialize the authentication error.
22
+
23
+ Args:
24
+ message: Error message
25
+ """
26
+ super().__init__(message)
27
+
28
+
29
+ class APIError(DayBetterError):
30
+ """API request failed."""
31
+
32
+ def __init__(self, message: str) -> None:
33
+ """Initialize the API error.
34
+
35
+ Args:
36
+ message: Error message
37
+ """
38
+ super().__init__(message)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: daybetter-services-python
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Python client for DayBetter devices and services
5
5
  Home-page: https://github.com/THDayBetter/daybetter-python
6
6
  Author: THDayBetter
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.9
21
21
  Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Typing :: Typed
24
25
  Requires-Python: >=3.8
25
26
  Description-Content-Type: text/markdown
26
27
  License-File: LICENSE
@@ -5,6 +5,7 @@ setup.py
5
5
  daybetter_python/__init__.py
6
6
  daybetter_python/client.py
7
7
  daybetter_python/exceptions.py
8
+ daybetter_python/py.typed
8
9
  daybetter_services_python.egg-info/PKG-INFO
9
10
  daybetter_services_python.egg-info/SOURCES.txt
10
11
  daybetter_services_python.egg-info/dependency_links.txt
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "daybetter-services-python"
7
- version = "1.0.6"
7
+ version = "1.0.7"
8
8
  description = "Python client for DayBetter devices and services"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -25,6 +25,7 @@ classifiers = [
25
25
  "Programming Language :: Python :: 3.10",
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
+ "Typing :: Typed",
28
29
  ]
29
30
  requires-python = ">=3.8"
30
31
  dependencies = [
@@ -55,3 +56,6 @@ target-version = ['py38']
55
56
  [tool.isort]
56
57
  profile = "black"
57
58
  line_length = 88
59
+
60
+ [tool.setuptools.package-data]
61
+ daybetter_python = ["py.typed"]
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="daybetter-services-python",
8
- version="1.0.6",
8
+ version="1.0.7",
9
9
  author="THDayBetter",
10
10
  author_email="chenp2368@163.com",
11
11
  description="Python client for DayBetter devices and services",
@@ -13,6 +13,9 @@ setup(
13
13
  long_description_content_type="text/markdown",
14
14
  url="https://github.com/THDayBetter/daybetter-python",
15
15
  packages=find_packages(),
16
+ package_data={
17
+ "daybetter_python": ["py.typed"],
18
+ },
16
19
  classifiers=[
17
20
  "Development Status :: 4 - Beta",
18
21
  "Intended Audience :: Developers",
@@ -23,6 +26,7 @@ setup(
23
26
  "Programming Language :: Python :: 3.10",
24
27
  "Programming Language :: Python :: 3.11",
25
28
  "Programming Language :: Python :: 3.12",
29
+ "Typing :: Typed",
26
30
  ],
27
31
  python_requires=">=3.8",
28
32
  install_requires=["aiohttp>=3.8.0"],
@@ -1,13 +0,0 @@
1
- """DayBetter client exceptions."""
2
-
3
-
4
- class DayBetterError(Exception):
5
- """Base exception for DayBetter client."""
6
-
7
-
8
- class AuthenticationError(DayBetterError):
9
- """Authentication failed."""
10
-
11
-
12
- class APIError(DayBetterError):
13
- """API request failed."""