HomeAssistant-API 6.0.1__tar.gz → 6.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.
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/PKG-INFO +15 -13
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/README.md +13 -11
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/entity_registry.py +1 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/processing.py +1 -3
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/pyproject.toml +2 -1
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/.gitignore +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/LICENSE +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/__init__.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/asyncclient.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/asyncwebsocket.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/baseclient.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/basewebsocket.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/client.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/errors.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/__init__.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/base.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/config_entries.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/domains.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/entity.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/events.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/history.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/logbook.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/states.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/websocket.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/py.typed +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/utils.py +0 -0
- {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/websocket.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: HomeAssistant-API
|
|
3
|
-
Version: 6.0
|
|
3
|
+
Version: 6.1.0
|
|
4
4
|
Summary: Python Wrapper for Homeassistant's REST API
|
|
5
5
|
Project-URL: Documentation, https://homeassistantapi.readthedocs.io
|
|
6
6
|
Project-URL: Homepage, https://github.com/HomeAssistant-API/HomeAssistantAPI
|
|
@@ -16,9 +16,9 @@ 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/main?include_prereleases&style=for-the-badge)
|
|
22
22
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
23
23
|
[](https://github.com/HomeAssistant-API/HomeAssistantAPI/releases)
|
|
24
24
|
|
|
@@ -38,10 +38,10 @@ Description-Content-Type: text/markdown
|
|
|
38
38
|
from homeassistant_api import Client
|
|
39
39
|
|
|
40
40
|
with Client(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
"<API Server URL>", # i.e. 'http://homeassistant.local:8123/api/'
|
|
42
|
+
"<Your Long Lived Access-Token>",
|
|
43
43
|
) as client:
|
|
44
|
-
client.trigger_service(
|
|
44
|
+
client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
All four client classes share the same method names.
|
|
@@ -51,12 +51,14 @@ The async clients (`AsyncClient`, `AsyncWebsocketClient`) use `async def` method
|
|
|
51
51
|
import asyncio
|
|
52
52
|
from homeassistant_api import AsyncClient
|
|
53
53
|
|
|
54
|
+
|
|
54
55
|
async def main():
|
|
55
56
|
async with AsyncClient(
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
"<REST API Server URL>", # i.e. 'http://homeassistant.local:8123/api/'
|
|
58
|
+
"<Your Long Lived Access-Token>",
|
|
58
59
|
) as client:
|
|
59
|
-
await client.trigger_service(
|
|
60
|
+
await client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
61
|
+
|
|
60
62
|
|
|
61
63
|
asyncio.run(main())
|
|
62
64
|
```
|
|
@@ -67,10 +69,10 @@ asyncio.run(main())
|
|
|
67
69
|
from homeassistant_api import WebsocketClient
|
|
68
70
|
|
|
69
71
|
with WebsocketClient(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
"<WS API Server URL>", # i.e. 'ws://homeassistant.local:8123/api/websocket'
|
|
73
|
+
"<Your Long Lived Access-Token>",
|
|
72
74
|
) as ws_client:
|
|
73
|
-
ws_client.trigger_service(
|
|
75
|
+
ws_client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
74
76
|
```
|
|
75
77
|
|
|
76
78
|
## Documentation
|
|
@@ -1,8 +1,8 @@
|
|
|
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/main?include_prereleases&style=for-the-badge)
|
|
6
6
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
7
7
|
[](https://github.com/HomeAssistant-API/HomeAssistantAPI/releases)
|
|
8
8
|
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
from homeassistant_api import Client
|
|
23
23
|
|
|
24
24
|
with Client(
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
"<API Server URL>", # i.e. 'http://homeassistant.local:8123/api/'
|
|
26
|
+
"<Your Long Lived Access-Token>",
|
|
27
27
|
) as client:
|
|
28
|
-
client.trigger_service(
|
|
28
|
+
client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
All four client classes share the same method names.
|
|
@@ -35,12 +35,14 @@ The async clients (`AsyncClient`, `AsyncWebsocketClient`) use `async def` method
|
|
|
35
35
|
import asyncio
|
|
36
36
|
from homeassistant_api import AsyncClient
|
|
37
37
|
|
|
38
|
+
|
|
38
39
|
async def main():
|
|
39
40
|
async with AsyncClient(
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
"<REST API Server URL>", # i.e. 'http://homeassistant.local:8123/api/'
|
|
42
|
+
"<Your Long Lived Access-Token>",
|
|
42
43
|
) as client:
|
|
43
|
-
await client.trigger_service(
|
|
44
|
+
await client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
45
|
+
|
|
44
46
|
|
|
45
47
|
asyncio.run(main())
|
|
46
48
|
```
|
|
@@ -51,10 +53,10 @@ asyncio.run(main())
|
|
|
51
53
|
from homeassistant_api import WebsocketClient
|
|
52
54
|
|
|
53
55
|
with WebsocketClient(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
"<WS API Server URL>", # i.e. 'ws://homeassistant.local:8123/api/websocket'
|
|
57
|
+
"<Your Long Lived Access-Token>",
|
|
56
58
|
) as ws_client:
|
|
57
|
-
ws_client.trigger_service(
|
|
59
|
+
ws_client.trigger_service("light", "turn_on", entity_id="light.living_room")
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
## Documentation
|
{homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/entity_registry.py
RENAMED
|
@@ -51,6 +51,7 @@ class EntityRegistryEntry(BaseModel):
|
|
|
51
51
|
hidden_by: EntityHiddenBy | None = None
|
|
52
52
|
icon: str | None = None
|
|
53
53
|
id: str
|
|
54
|
+
labels: set[str] = Field(default_factory=set)
|
|
54
55
|
modified_at: DatetimeIsoField
|
|
55
56
|
name: str | None = None
|
|
56
57
|
options: dict[str, Any] = Field(default_factory=dict)
|
|
@@ -117,9 +117,7 @@ _PARSERS: dict[str, Callable[[ResponseType], Any]] = {
|
|
|
117
117
|
def _parse_content(response: ResponseType) -> Any:
|
|
118
118
|
"""Look up and call the appropriate parser by content-type."""
|
|
119
119
|
content_type = response.headers.get("content-type", "text/plain")
|
|
120
|
-
|
|
121
|
-
content_type = content_type.decode("utf-8") # pragma: no cover
|
|
122
|
-
mimetype = str(content_type).split(";")[0].strip().lower()
|
|
120
|
+
mimetype = content_type.split(";")[0].strip().lower()
|
|
123
121
|
|
|
124
122
|
if (parser := _PARSERS.get(mimetype)) is None:
|
|
125
123
|
msg = f"No response processor found for mimetype {mimetype!r}."
|
|
@@ -4,7 +4,7 @@ requires = ["hatchling"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "HomeAssistant-API"
|
|
7
|
-
version = "6.0
|
|
7
|
+
version = "6.1.0"
|
|
8
8
|
description = "Python Wrapper for Homeassistant's REST API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "GPL-3.0-or-later"
|
|
@@ -91,6 +91,7 @@ ignore = [
|
|
|
91
91
|
"FBT",
|
|
92
92
|
"TD",
|
|
93
93
|
"FIX",
|
|
94
|
+
"CPY",
|
|
94
95
|
]
|
|
95
96
|
|
|
96
97
|
[tool.ruff.lint.per-file-ignores]
|
|
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
|
|
File without changes
|
{homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/config_entries.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
|
|
File without changes
|