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.
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/PKG-INFO +8 -8
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/README.md +5 -5
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/__init__.py +4 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/asyncwebsocket.py +1 -1
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/client.py +1 -1
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/errors.py +1 -1
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/domains.py +34 -1
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/pyproject.toml +6 -4
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/.gitignore +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/LICENSE +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/asyncclient.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/baseclient.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/basewebsocket.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/__init__.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/base.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/config_entries.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/entity.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/entity_registry.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/events.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/history.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/logbook.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/states.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/websocket.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/processing.py +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/py.typed +0 -0
- {homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/utils.py +0 -0
- {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.
|
|
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/
|
|
7
|
-
Project-URL: Repository, https://github.com/
|
|
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
|
-
[](https://codecov.io/gh/HomeAssistant-API/HomeAssistantAPI)
|
|
20
20
|
[](https://pypistats.org/packages/homeassistant-api)
|
|
21
|
-
](https://img.shields.io/github/commits-since/HomeAssistant-API/HomeAssistantAPI/latest/dev?include_prereleases&style=for-the-badge)
|
|
22
22
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
23
|
-
[](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/
|
|
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/
|
|
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
|
-
[](https://codecov.io/gh/HomeAssistant-API/HomeAssistantAPI)
|
|
4
4
|
[](https://pypistats.org/packages/homeassistant-api)
|
|
5
|
-
](https://img.shields.io/github/commits-since/HomeAssistant-API/HomeAssistantAPI/latest/dev?include_prereleases&style=for-the-badge)
|
|
6
6
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
7
|
-
[](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/
|
|
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/
|
|
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
|
|
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 :
|
|
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/
|
|
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
|
|
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.
|
|
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/
|
|
24
|
-
Repository = "https://github.com/
|
|
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
|
-
"
|
|
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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/config_entries.py
RENAMED
|
File without changes
|
|
File without changes
|
{homeassistant_api-6.0.0 → homeassistant_api-6.0.1}/homeassistant_api/models/entity_registry.py
RENAMED
|
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
|