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.
Files changed (27) hide show
  1. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/PKG-INFO +15 -13
  2. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/README.md +13 -11
  3. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/entity_registry.py +1 -0
  4. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/processing.py +1 -3
  5. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/pyproject.toml +2 -1
  6. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/.gitignore +0 -0
  7. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/LICENSE +0 -0
  8. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/__init__.py +0 -0
  9. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/asyncclient.py +0 -0
  10. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/asyncwebsocket.py +0 -0
  11. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/baseclient.py +0 -0
  12. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/basewebsocket.py +0 -0
  13. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/client.py +0 -0
  14. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/errors.py +0 -0
  15. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/__init__.py +0 -0
  16. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/base.py +0 -0
  17. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/config_entries.py +0 -0
  18. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/domains.py +0 -0
  19. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/entity.py +0 -0
  20. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/events.py +0 -0
  21. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/history.py +0 -0
  22. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/logbook.py +0 -0
  23. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/states.py +0 -0
  24. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/models/websocket.py +0 -0
  25. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/py.typed +0 -0
  26. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/utils.py +0 -0
  27. {homeassistant_api-6.0.1 → homeassistant_api-6.1.0}/homeassistant_api/websocket.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: HomeAssistant-API
3
- Version: 6.0.1
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
- [![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)
19
+ [![Code Coverage](https://img.shields.io/codecov/c/github/HomeAssistant-API/HomeAssistantAPI/main?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/HomeAssistant-API/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/main?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
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
 
@@ -38,10 +38,10 @@ Description-Content-Type: text/markdown
38
38
  from homeassistant_api import Client
39
39
 
40
40
  with Client(
41
- '<API Server URL>', # i.e. 'http://homeassistant.local:8123/api/'
42
- '<Your Long Lived Access-Token>'
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('light', 'turn_on', entity_id="light.living_room")
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
- '<REST API Server URL>', # i.e. 'http://homeassistant.local:8123/api/'
57
- '<Your Long Lived Access-Token>',
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('light', 'turn_on', entity_id="light.living_room")
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
- '<WS API Server URL>', # i.e. 'ws://homeassistant.local:8123/api/websocket'
71
- '<Your Long Lived Access-Token>'
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('light', 'turn_on', entity_id="light.living_room")
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
- [![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)
3
+ [![Code Coverage](https://img.shields.io/codecov/c/github/HomeAssistant-API/HomeAssistantAPI/main?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/HomeAssistant-API/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/main?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
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
 
@@ -22,10 +22,10 @@
22
22
  from homeassistant_api import Client
23
23
 
24
24
  with Client(
25
- '<API Server URL>', # i.e. 'http://homeassistant.local:8123/api/'
26
- '<Your Long Lived Access-Token>'
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('light', 'turn_on', entity_id="light.living_room")
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
- '<REST API Server URL>', # i.e. 'http://homeassistant.local:8123/api/'
41
- '<Your Long Lived Access-Token>',
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('light', 'turn_on', entity_id="light.living_room")
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
- '<WS API Server URL>', # i.e. 'ws://homeassistant.local:8123/api/websocket'
55
- '<Your Long Lived Access-Token>'
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('light', 'turn_on', entity_id="light.living_room")
59
+ ws_client.trigger_service("light", "turn_on", entity_id="light.living_room")
58
60
  ```
59
61
 
60
62
  ## Documentation
@@ -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
- if isinstance(content_type, bytes):
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.1"
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]