HomeAssistant-API 6.0.0__tar.gz → 6.0.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.
Files changed (27) hide show
  1. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/PKG-INFO +8 -8
  2. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/README.md +5 -5
  3. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/__init__.py +4 -0
  4. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/asyncwebsocket.py +1 -1
  5. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/client.py +1 -1
  6. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/errors.py +1 -1
  7. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/domains.py +34 -1
  8. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/pyproject.toml +6 -4
  9. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/.gitignore +0 -0
  10. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/LICENSE +0 -0
  11. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/asyncclient.py +0 -0
  12. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/baseclient.py +0 -0
  13. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/basewebsocket.py +0 -0
  14. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/__init__.py +0 -0
  15. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/base.py +0 -0
  16. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/config_entries.py +0 -0
  17. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/entity.py +0 -0
  18. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/entity_registry.py +0 -0
  19. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/events.py +0 -0
  20. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/history.py +0 -0
  21. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/logbook.py +0 -0
  22. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/states.py +0 -0
  23. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/websocket.py +0 -0
  24. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/processing.py +0 -0
  25. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/py.typed +0 -0
  26. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/utils.py +0 -0
  27. {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/websocket.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: HomeAssistant-API
3
- Version: 6.0.0
3
+ Version: 6.0.1
4
4
  Summary: Python Wrapper for Homeassistant's REST API
5
5
  Project-URL: Documentation, https://homeassistantapi.readthedocs.io
6
- Project-URL: Homepage, https://github.com/GrandMoff100/HomeAssistantAPI
7
- Project-URL: Repository, https://github.com/GrandMoff100/HomeAssistantAPI
6
+ Project-URL: Homepage, https://github.com/HomeAssistant-API/HomeAssistantAPI
7
+ Project-URL: Repository, https://github.com/HomeAssistant-API/HomeAssistantAPI
8
8
  Author-email: GrandMoff100 <minecraftcrusher100@gmail.com>
9
9
  License-Expression: GPL-3.0-or-later
10
10
  License-File: LICENSE
@@ -16,14 +16,14 @@ Description-Content-Type: text/markdown
16
16
 
17
17
  # HomeassistantAPI
18
18
 
19
- [![Code Coverage](https://img.shields.io/codecov/c/github/GrandMoff100/HomeAssistantAPI/dev?style=for-the-badge&token=SJFC3HX5R1)](https://codecov.io/gh/GrandMoff100/HomeAssistantAPI)
19
+ [![Code Coverage](https://img.shields.io/codecov/c/github/HomeAssistant-API/HomeAssistantAPI/dev?style=for-the-badge&token=SJFC3HX5R1)](https://codecov.io/gh/HomeAssistant-API/HomeAssistantAPI)
20
20
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/HomeAssistant-API?style=for-the-badge)](https://pypistats.org/packages/homeassistant-api)
21
- ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/GrandMoff100/HomeassistantAPI/latest/dev?include_prereleases&style=for-the-badge)
21
+ ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/HomeAssistant-API/HomeAssistantAPI/latest/dev?include_prereleases&style=for-the-badge)
22
22
  [![Read the Docs (version)](https://img.shields.io/readthedocs/homeassistantapi?style=for-the-badge)](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
23
- [![GitHub release (latest by date)](https://img.shields.io/github/v/release/GrandMoff100/HomeassistantAPI?style=for-the-badge)](https://github.com/GrandMoff100/HomeassistantAPI/releases)
23
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/HomeAssistant-API/HomeAssistantAPI?style=for-the-badge)](https://github.com/HomeAssistant-API/HomeAssistantAPI/releases)
24
24
 
25
25
  <a href="https://home-assistant.io">
26
- <img src="https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="80%">
26
+ <img src="https://github.com/HomeAssistant-API/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="80%">
27
27
  </a>
28
28
 
29
29
  ## Python wrapper for Homeassistant's [Websocket API](https://developers.home-assistant.io/docs/api/websocket/) and [REST API](https://developers.home-assistant.io/docs/api/rest/)
@@ -81,7 +81,7 @@ you'd want to know is on our readthedocs site [here](https://homeassistantapi.re
81
81
  If there is something missing, open an issue and let us know! Thanks!
82
82
 
83
83
  Go make some cool stuff! Maybe come back and tell us about it in a
84
- [discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)?
84
+ [discussion](https://github.com/HomeAssistant-API/HomeAssistantAPI/discussions)?
85
85
  We'd love to hear about how you use our library!!
86
86
 
87
87
  ## License
@@ -1,13 +1,13 @@
1
1
  # HomeassistantAPI
2
2
 
3
- [![Code Coverage](https://img.shields.io/codecov/c/github/GrandMoff100/HomeAssistantAPI/dev?style=for-the-badge&token=SJFC3HX5R1)](https://codecov.io/gh/GrandMoff100/HomeAssistantAPI)
3
+ [![Code Coverage](https://img.shields.io/codecov/c/github/HomeAssistant-API/HomeAssistantAPI/dev?style=for-the-badge&token=SJFC3HX5R1)](https://codecov.io/gh/HomeAssistant-API/HomeAssistantAPI)
4
4
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/HomeAssistant-API?style=for-the-badge)](https://pypistats.org/packages/homeassistant-api)
5
- ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/GrandMoff100/HomeassistantAPI/latest/dev?include_prereleases&style=for-the-badge)
5
+ ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/HomeAssistant-API/HomeAssistantAPI/latest/dev?include_prereleases&style=for-the-badge)
6
6
  [![Read the Docs (version)](https://img.shields.io/readthedocs/homeassistantapi?style=for-the-badge)](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
7
- [![GitHub release (latest by date)](https://img.shields.io/github/v/release/GrandMoff100/HomeassistantAPI?style=for-the-badge)](https://github.com/GrandMoff100/HomeassistantAPI/releases)
7
+ [![GitHub release (latest by date)](https://img.shields.io/github/v/release/HomeAssistant-API/HomeAssistantAPI?style=for-the-badge)](https://github.com/HomeAssistant-API/HomeAssistantAPI/releases)
8
8
 
9
9
  <a href="https://home-assistant.io">
10
- <img src="https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="80%">
10
+ <img src="https://github.com/HomeAssistant-API/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="80%">
11
11
  </a>
12
12
 
13
13
  ## Python wrapper for Homeassistant's [Websocket API](https://developers.home-assistant.io/docs/api/websocket/) and [REST API](https://developers.home-assistant.io/docs/api/rest/)
@@ -65,7 +65,7 @@ you'd want to know is on our readthedocs site [here](https://homeassistantapi.re
65
65
  If there is something missing, open an issue and let us know! Thanks!
66
66
 
67
67
  Go make some cool stuff! Maybe come back and tell us about it in a
68
- [discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)?
68
+ [discussion](https://github.com/HomeAssistant-API/HomeAssistantAPI/discussions)?
69
69
  We'd love to hear about how you use our library!!
70
70
 
71
71
  ## License
@@ -11,11 +11,13 @@ __all__ = (
11
11
  "AuthInvalid",
12
12
  "AuthOk",
13
13
  "AuthRequired",
14
+ "BaseClient",
14
15
  "BaseDomain",
15
16
  "BaseEntity",
16
17
  "BaseEvent",
17
18
  "BaseGroup",
18
19
  "BaseService",
20
+ "BaseWebsocketClient",
19
21
  "Client",
20
22
  "ConfigEntry",
21
23
  "ConfigEntryChange",
@@ -55,6 +57,8 @@ __all__ = (
55
57
 
56
58
  from .asyncclient import AsyncClient
57
59
  from .asyncwebsocket import AsyncWebsocketClient
60
+ from .baseclient import BaseClient
61
+ from .basewebsocket import BaseWebsocketClient
58
62
  from .client import Client
59
63
  from .models.config_entries import ConfigEntry
60
64
  from .models.config_entries import ConfigEntryChange
@@ -472,7 +472,7 @@ class AsyncWebsocketClient(BaseWebsocketClient):
472
472
  """
473
473
  Listen for all events of a certain type.
474
474
 
475
- For example, to listen for all events of type `test_event`:
475
+ For example, to listen for all events of type :code:`test_event`:
476
476
 
477
477
  .. code-block:: python
478
478
 
@@ -44,7 +44,7 @@ class Client(BaseClient):
44
44
  :param token: The refresh or long lived access token to authenticate your requests. Required.
45
45
  :param session: A custom :py:class:`niquests.Session` instance. Optional.
46
46
  :param verify_ssl: Whether to verify SSL certificates. Default :code:`True`.
47
- :param global_request_kwargs: Kwargs to pass to :func:`requests.request`. Optional.
47
+ :param global_request_kwargs: Kwargs to pass to :py:meth:`niquests.Session.request`. Optional.
48
48
  """ # pylint: disable=line-too-long
49
49
 
50
50
  _session: Session
@@ -68,7 +68,7 @@ class InternalServerError(HomeassistantAPIError):
68
68
  f"Home Assistant returned a response with an error status code {status_code!r}.\n"
69
69
  f"{content!r}\n"
70
70
  "If this happened, "
71
- "please report it at https://github.com/GrandMoff100/HomeAssistantAPI/issues "
71
+ "please report it at https://github.com/HomeAssistant-API/HomeAssistantAPI/issues "
72
72
  "with the request status code and the request content. Thanks!",
73
73
  )
74
74
 
@@ -24,6 +24,15 @@ if TYPE_CHECKING:
24
24
 
25
25
  from .states import State
26
26
 
27
+ __all__ = (
28
+ "AsyncDomain",
29
+ "AsyncService",
30
+ "BaseDomain",
31
+ "BaseService",
32
+ "Domain",
33
+ "Service",
34
+ )
35
+
27
36
 
28
37
  class BaseDomain(BaseModel):
29
38
  """Model representing the domain that services belong to."""
@@ -64,7 +73,7 @@ class BaseDomain(BaseModel):
64
73
  raise NotImplementedError
65
74
 
66
75
  def get_service(self, service_id: str) -> BaseService | None:
67
- """Return a Service with the given service_id, returns None if no such service exists"""
76
+ """Return a Service with the given :code:`service_id`, returns None if no such service exists"""
68
77
  return self.services.get(service_id)
69
78
 
70
79
  def __getattr__(self, attr: str) -> Any:
@@ -630,6 +639,18 @@ class Service(BaseService):
630
639
  **service_data,
631
640
  )
632
641
 
642
+ def __call__(
643
+ self,
644
+ **service_data: Any,
645
+ ) -> (
646
+ tuple[State, ...]
647
+ | tuple[tuple[State, ...], dict[str, Any]]
648
+ | dict[str, Any]
649
+ | None
650
+ ):
651
+ """Calls the service associated with this object."""
652
+ return self.trigger(**service_data)
653
+
633
654
 
634
655
  class AsyncService(BaseService):
635
656
  """Async service with async trigger method."""
@@ -658,3 +679,15 @@ class AsyncService(BaseService):
658
679
  self.service_id,
659
680
  **service_data,
660
681
  )
682
+
683
+ async def __call__(
684
+ self,
685
+ **service_data: Any,
686
+ ) -> (
687
+ tuple[State, ...]
688
+ | tuple[tuple[State, ...], dict[str, Any]]
689
+ | dict[str, Any]
690
+ | None
691
+ ):
692
+ """Calls the service associated with this object."""
693
+ return await self.trigger(**service_data)
@@ -4,7 +4,7 @@ requires = ["hatchling"]
4
4
 
5
5
  [project]
6
6
  name = "HomeAssistant-API"
7
- version = "6.0.0"
7
+ version = "6.0.1"
8
8
  description = "Python Wrapper for Homeassistant's REST API"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0-or-later"
@@ -20,14 +20,16 @@ dependencies = [
20
20
 
21
21
  [project.urls]
22
22
  Documentation = "https://homeassistantapi.readthedocs.io"
23
- Homepage = "https://github.com/GrandMoff100/HomeAssistantAPI"
24
- Repository = "https://github.com/GrandMoff100/HomeAssistantAPI"
23
+ Homepage = "https://github.com/HomeAssistant-API/HomeAssistantAPI"
24
+ Repository = "https://github.com/HomeAssistant-API/HomeAssistantAPI"
25
25
 
26
26
  [dependency-groups]
27
27
  docs = [
28
28
  "sphinx-autodoc-typehints>=3,<4",
29
29
  "sphinx-rtd-theme>=3,<4",
30
- "autodoc-pydantic>=2,<3",
30
+ "sphinx-autobuild>=2025.8.25",
31
+ "sphinxcontrib-pydantic>=0.3.0",
32
+ "sphinx>=9"
31
33
  ]
32
34
  dev = [
33
35
  "types-docutils>=0.22",