HomeAssistant-API 4.0.0.post2__tar.gz → 4.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-4.0.0.post2 → homeassistant_api-4.1.0}/LICENSE +0 -53
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/PKG-INFO +8 -5
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/README.md +3 -1
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/client.py +8 -13
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/errors.py +4 -2
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/states.py +4 -1
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/processing.py +15 -9
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/rawasyncclient.py +3 -3
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/rawclient.py +10 -9
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/pyproject.toml +40 -34
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/setup.py +6 -6
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/__init__.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/__init__.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/base.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/domains.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/entity.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/events.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/history.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/logbook.py +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/py.typed +0 -0
- {HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/rawbaseclient.py +0 -0
|
@@ -619,56 +619,3 @@ Program, unless a warranty or assumption of liability accompanies a
|
|
|
619
619
|
copy of the Program in return for a fee.
|
|
620
620
|
|
|
621
621
|
END OF TERMS AND CONDITIONS
|
|
622
|
-
|
|
623
|
-
How to Apply These Terms to Your New Programs
|
|
624
|
-
|
|
625
|
-
If you develop a new program, and you want it to be of the greatest
|
|
626
|
-
possible use to the public, the best way to achieve this is to make it
|
|
627
|
-
free software which everyone can redistribute and change under these terms.
|
|
628
|
-
|
|
629
|
-
To do so, attach the following notices to the program. It is safest
|
|
630
|
-
to attach them to the start of each source file to most effectively
|
|
631
|
-
state the exclusion of warranty; and each file should have at least
|
|
632
|
-
the "copyright" line and a pointer to where the full notice is found.
|
|
633
|
-
|
|
634
|
-
<one line to give the program's name and a brief idea of what it does.>
|
|
635
|
-
Copyright (C) <year> <name of author>
|
|
636
|
-
|
|
637
|
-
This program is free software: you can redistribute it and/or modify
|
|
638
|
-
it under the terms of the GNU General Public License as published by
|
|
639
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
640
|
-
(at your option) any later version.
|
|
641
|
-
|
|
642
|
-
This program is distributed in the hope that it will be useful,
|
|
643
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
644
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
645
|
-
GNU General Public License for more details.
|
|
646
|
-
|
|
647
|
-
You should have received a copy of the GNU General Public License
|
|
648
|
-
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
649
|
-
|
|
650
|
-
Also add information on how to contact you by electronic and paper mail.
|
|
651
|
-
|
|
652
|
-
If the program does terminal interaction, make it output a short
|
|
653
|
-
notice like this when it starts in an interactive mode:
|
|
654
|
-
|
|
655
|
-
<program> Copyright (C) <year> <name of author>
|
|
656
|
-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
657
|
-
This is free software, and you are welcome to redistribute it
|
|
658
|
-
under certain conditions; type `show c' for details.
|
|
659
|
-
|
|
660
|
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
661
|
-
parts of the General Public License. Of course, your program's commands
|
|
662
|
-
might be different; for a GUI interface, you would use an "about box".
|
|
663
|
-
|
|
664
|
-
You should also get your employer (if you work as a programmer) or school,
|
|
665
|
-
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
666
|
-
For more information on this, and how to apply and follow the GNU GPL, see
|
|
667
|
-
<https://www.gnu.org/licenses/>.
|
|
668
|
-
|
|
669
|
-
The GNU General Public License does not permit incorporating your program
|
|
670
|
-
into proprietary programs. If your program is a subroutine library, you
|
|
671
|
-
may consider it more useful to permit linking proprietary applications with
|
|
672
|
-
the library. If this is what you want to do, use the GNU Lesser General
|
|
673
|
-
Public License instead of this License. But first, please read
|
|
674
|
-
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: homeassistant-api
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: Python Wrapper for Homeassistant's REST API
|
|
5
5
|
Home-page: https://github.com/GrandMoff100/HomeAssistantAPI
|
|
6
6
|
License: GPL-3.0-or-later
|
|
7
7
|
Author: GrandMoff100
|
|
8
8
|
Author-email: minecraftcrusher100@gmail.com
|
|
9
|
-
Requires-Python: >=3.7,<4.0
|
|
9
|
+
Requires-Python: >=3.7,<4.0
|
|
10
10
|
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.7
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
17
|
Requires-Dist: aiohttp (>=3.8.1,<4.0.0)
|
|
17
18
|
Requires-Dist: aiohttp-client-cache (>=0.6.1,<0.7.0)
|
|
18
19
|
Requires-Dist: pydantic (<=1.9.0)
|
|
19
|
-
Requires-Dist: requests (
|
|
20
|
+
Requires-Dist: requests (>=2.27.1,<3.0.0)
|
|
20
21
|
Requires-Dist: requests-cache (>=0.9.2,<0.10.0)
|
|
21
22
|
Requires-Dist: simplejson (>=3.17.6,<4.0.0)
|
|
22
23
|
Project-URL: Documentation, https://homeassistantapi.readthedocs.io
|
|
@@ -31,7 +32,9 @@ Description-Content-Type: text/markdown
|
|
|
31
32
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
32
33
|
[](https://github.com/GrandMoff100/HomeassistantAPI/releases)
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
<a href="https://home-assistant.io">
|
|
36
|
+
<img src="https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="60%">
|
|
37
|
+
</a>
|
|
35
38
|
|
|
36
39
|
## Python wrapper for Homeassistant's [REST API](https://developers.home-assistant.io/docs/api/rest/)
|
|
37
40
|
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)
|
|
7
7
|
[](https://github.com/GrandMoff100/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="60%">
|
|
11
|
+
</a>
|
|
10
12
|
|
|
11
13
|
## Python wrapper for Homeassistant's [REST API](https://developers.home-assistant.io/docs/api/rest/)
|
|
12
14
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Module containing the primary Client class."""
|
|
2
|
-
import
|
|
3
|
-
import inspect
|
|
2
|
+
import logging
|
|
4
3
|
from typing import Any
|
|
5
4
|
|
|
6
5
|
from .rawasyncclient import RawAsyncClient
|
|
7
6
|
from .rawclient import RawClient
|
|
8
7
|
|
|
8
|
+
logger = logging.getLogger(__name__)
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
class Client(RawClient, RawAsyncClient):
|
|
11
12
|
"""
|
|
@@ -18,14 +19,8 @@ class Client(RawClient, RawAsyncClient):
|
|
|
18
19
|
:param async_cache_session: A :py:class:`aiohttp_client_cache.CachedSession` object to use for caching requests. Optional.
|
|
19
20
|
""" # pylint: disable=line-too-long
|
|
20
21
|
|
|
21
|
-
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
caller := gc.get_referrers(parent_frame.f_code)[0]
|
|
27
|
-
) or inspect.iscoroutine(caller):
|
|
28
|
-
RawAsyncClient.__init__(self, *args, **kwargs)
|
|
29
|
-
except IndexError: # pragma: no cover
|
|
30
|
-
pass
|
|
31
|
-
RawClient.__init__(self, *args, **kwargs)
|
|
22
|
+
def __init__(self, *args: Any, use_async: bool = False, **kwargs: Any) -> None:
|
|
23
|
+
if use_async:
|
|
24
|
+
RawAsyncClient.__init__(self, *args, **kwargs)
|
|
25
|
+
else:
|
|
26
|
+
RawClient.__init__(self, *args, **kwargs)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Module for custom error classes"""
|
|
2
2
|
|
|
3
|
+
from typing import Union
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
class HomeassistantAPIError(BaseException):
|
|
5
7
|
"""Base class for custom errors"""
|
|
@@ -40,10 +42,10 @@ class ParameterMissingError(HomeassistantAPIError):
|
|
|
40
42
|
class InternalServerError(HomeassistantAPIError):
|
|
41
43
|
"""Error raised when Home Assistant says that it got itself in trouble."""
|
|
42
44
|
|
|
43
|
-
def __init__(self, status_code: int, content: str) -> None:
|
|
45
|
+
def __init__(self, status_code: int, content: Union[str, bytes]) -> None:
|
|
44
46
|
super().__init__(
|
|
45
47
|
f"Home Assistant returned a response with an error status code {status_code!r}.\n"
|
|
46
|
-
f"{content}\n"
|
|
48
|
+
f"{content!r}\n"
|
|
47
49
|
"If this happened, "
|
|
48
50
|
"please report it at https://github.com/GrandMoff100/HomeAssistantAPI/issues "
|
|
49
51
|
"with the request status code and the request content. Thanks!"
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/states.py
RENAMED
|
@@ -10,7 +10,10 @@ from .base import BaseModel
|
|
|
10
10
|
class Context(BaseModel):
|
|
11
11
|
"""Model for entity state contexts."""
|
|
12
12
|
|
|
13
|
-
id: str = Field(
|
|
13
|
+
id: str = Field(
|
|
14
|
+
max_length=128,
|
|
15
|
+
description="Unique string identifying the context.",
|
|
16
|
+
)
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
class State(BaseModel):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Module for processing responses from homeassistant."""
|
|
1
|
+
"""Module for processing API responses from homeassistant."""
|
|
2
2
|
|
|
3
3
|
import inspect
|
|
4
4
|
import json
|
|
@@ -37,8 +37,9 @@ class Processing:
|
|
|
37
37
|
_response: AllResponseType
|
|
38
38
|
_processors: ClassVar[Dict[str, Tuple[ProcessorType, ...]]] = {}
|
|
39
39
|
|
|
40
|
-
def __init__(self, response: AllResponseType) -> None:
|
|
40
|
+
def __init__(self, response: AllResponseType, decode_bytes: bool = True) -> None:
|
|
41
41
|
self._response = response
|
|
42
|
+
self._decode_bytes = decode_bytes
|
|
42
43
|
|
|
43
44
|
@staticmethod
|
|
44
45
|
def processor(mimetype: str) -> Callable[[ProcessorType], ProcessorType]:
|
|
@@ -72,13 +73,17 @@ class Processing:
|
|
|
72
73
|
|
|
73
74
|
def process(self) -> Any:
|
|
74
75
|
"""Validates the http status code before starting to process the repsonse content"""
|
|
76
|
+
content: Union[str, bytes]
|
|
75
77
|
if async_ := isinstance(self._response, (ClientResponse, AsyncCachedResponse)):
|
|
76
78
|
status_code = self._response.status
|
|
77
79
|
_buffer = self._response.content._buffer
|
|
78
|
-
content = "" if not _buffer else _buffer[0]
|
|
80
|
+
content = b"" if not _buffer else _buffer[0]
|
|
79
81
|
elif isinstance(self._response, (Response, CachedResponse)):
|
|
80
82
|
status_code = self._response.status_code
|
|
81
|
-
content = self._response.content
|
|
83
|
+
content = self._response.content
|
|
84
|
+
if self._decode_bytes and isinstance(content, bytes):
|
|
85
|
+
content = content.decode()
|
|
86
|
+
|
|
82
87
|
if status_code in (200, 201):
|
|
83
88
|
return self.process_content(async_=async_)
|
|
84
89
|
if status_code == 400:
|
|
@@ -88,11 +93,10 @@ class Processing:
|
|
|
88
93
|
if status_code == 404:
|
|
89
94
|
raise EndpointNotFoundError(str(self._response.url))
|
|
90
95
|
if status_code == 405:
|
|
91
|
-
|
|
92
|
-
self._response.request.method
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
+
if isinstance(self._response, (Response, CachedResponse)):
|
|
97
|
+
method = self._response.request.method
|
|
98
|
+
else:
|
|
99
|
+
method = self._response.method
|
|
96
100
|
raise MethodNotAllowedError(cast(str, method))
|
|
97
101
|
if status_code >= 500:
|
|
98
102
|
raise InternalServerError(status_code, content)
|
|
@@ -111,6 +115,7 @@ def process_json(response: ResponseType) -> Dict[str, Any]:
|
|
|
111
115
|
) from err
|
|
112
116
|
|
|
113
117
|
|
|
118
|
+
@Processing.processor("text/plain") # type: ignore[arg-type]
|
|
114
119
|
@Processing.processor("application/octet-stream") # type: ignore[arg-type]
|
|
115
120
|
def process_text(response: ResponseType) -> str:
|
|
116
121
|
"""Returns the plaintext of the reponse."""
|
|
@@ -128,6 +133,7 @@ async def async_process_json(response: AsyncResponseType) -> Dict[str, Any]:
|
|
|
128
133
|
) from err
|
|
129
134
|
|
|
130
135
|
|
|
136
|
+
@Processing.processor("text/plain") # type: ignore[arg-type]
|
|
131
137
|
@Processing.processor("application/octet-stream") # type: ignore[arg-type]
|
|
132
138
|
async def async_process_text(response: AsyncResponseType) -> str:
|
|
133
139
|
"""Returns the plaintext of the reponse."""
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/rawasyncclient.py
RENAMED
|
@@ -56,7 +56,7 @@ class RawAsyncClient(RawBaseClient):
|
|
|
56
56
|
] = None, # Explicitly disable cache with async_cache_session=False
|
|
57
57
|
**kwargs,
|
|
58
58
|
):
|
|
59
|
-
|
|
59
|
+
RawBaseClient.__init__(self, *args, **kwargs)
|
|
60
60
|
if async_cache_session is False:
|
|
61
61
|
self.async_cache_session = aiohttp.ClientSession()
|
|
62
62
|
elif async_cache_session is None:
|
|
@@ -77,9 +77,9 @@ class RawAsyncClient(RawBaseClient):
|
|
|
77
77
|
await self.async_check_api_running()
|
|
78
78
|
return self
|
|
79
79
|
|
|
80
|
-
async def __aexit__(self,
|
|
80
|
+
async def __aexit__(self, _, __, ___):
|
|
81
81
|
logger.debug("Exiting async requests session %r", self.async_cache_session)
|
|
82
|
-
await self.async_cache_session.
|
|
82
|
+
await self.async_cache_session.close()
|
|
83
83
|
|
|
84
84
|
# Very important request function
|
|
85
85
|
async def async_request(
|
|
@@ -36,7 +36,7 @@ logger = logging.getLogger(__name__)
|
|
|
36
36
|
|
|
37
37
|
class RawClient(RawBaseClient):
|
|
38
38
|
"""
|
|
39
|
-
The base object for interacting with Homeassistant
|
|
39
|
+
The base object for interacting with Homeassistant.
|
|
40
40
|
|
|
41
41
|
:param api_url: The location of the api endpoint. e.g. :code:`http://localhost:8123/api` Required.
|
|
42
42
|
:param token: The refresh or long lived access token to authenticate your requests. Required.
|
|
@@ -55,7 +55,7 @@ class RawClient(RawBaseClient):
|
|
|
55
55
|
] = None, # Explicitly disable cache with cache_session=False
|
|
56
56
|
**kwargs,
|
|
57
57
|
):
|
|
58
|
-
|
|
58
|
+
RawBaseClient.__init__(self, *args, **kwargs)
|
|
59
59
|
if cache_session is False:
|
|
60
60
|
self.cache_session = requests.Session()
|
|
61
61
|
elif cache_session is None:
|
|
@@ -74,15 +74,16 @@ class RawClient(RawBaseClient):
|
|
|
74
74
|
self.check_api_config()
|
|
75
75
|
return self
|
|
76
76
|
|
|
77
|
-
def __exit__(self,
|
|
77
|
+
def __exit__(self, _, __, ___):
|
|
78
78
|
logger.debug("Exiting requests session %r", self.cache_session)
|
|
79
|
-
self.cache_session.
|
|
79
|
+
self.cache_session.close()
|
|
80
80
|
|
|
81
81
|
def request(
|
|
82
82
|
self,
|
|
83
83
|
path,
|
|
84
84
|
method="GET",
|
|
85
85
|
headers: Dict[str, str] = None,
|
|
86
|
+
decode_bytes: bool = True,
|
|
86
87
|
**kwargs,
|
|
87
88
|
) -> Any:
|
|
88
89
|
"""Base method for making requests to the api"""
|
|
@@ -101,12 +102,12 @@ class RawClient(RawBaseClient):
|
|
|
101
102
|
raise RequestTimeoutError(
|
|
102
103
|
f'Home Assistant did not respond in time (timeout: {kwargs.get("timeout", 300)} sec)'
|
|
103
104
|
) from err
|
|
104
|
-
return self.response_logic(resp)
|
|
105
|
+
return self.response_logic(response=resp, decode_bytes=decode_bytes)
|
|
105
106
|
|
|
106
107
|
@classmethod
|
|
107
|
-
def response_logic(cls, response: ResponseType) -> Any:
|
|
108
|
+
def response_logic(cls, response: ResponseType, decode_bytes: bool = True) -> Any:
|
|
108
109
|
"""Processes responses from the API and formats them"""
|
|
109
|
-
return Processing(response=response).process()
|
|
110
|
+
return Processing(response=response, decode_bytes=decode_bytes).process()
|
|
110
111
|
|
|
111
112
|
# API information methods
|
|
112
113
|
def get_error_log(self) -> str:
|
|
@@ -236,7 +237,7 @@ class RawClient(RawBaseClient):
|
|
|
236
237
|
|
|
237
238
|
# Services and domain methods
|
|
238
239
|
def get_domains(self) -> Dict[str, Domain]:
|
|
239
|
-
"""Fetches all :py:class:`Service`s from the API."""
|
|
240
|
+
"""Fetches all :py:class:`Service` 's from the API."""
|
|
240
241
|
data = self.request("services")
|
|
241
242
|
domains = map(
|
|
242
243
|
lambda json: Domain.from_json(json, client=cast(Client, self)),
|
|
@@ -245,7 +246,7 @@ class RawClient(RawBaseClient):
|
|
|
245
246
|
return {domain.domain_id: domain for domain in domains}
|
|
246
247
|
|
|
247
248
|
def get_domain(self, domain_id: str) -> Optional[Domain]:
|
|
248
|
-
"""Fetches all
|
|
249
|
+
"""Fetches all :py:class:`Service`'s under a particular service :py:class:`Domain`."""
|
|
249
250
|
return self.get_domains().get(domain_id)
|
|
250
251
|
|
|
251
252
|
def trigger_service(
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
build-backend = "poetry.core.masonry.api"
|
|
3
3
|
requires = ["poetry-core>=1.0.0"]
|
|
4
4
|
|
|
5
|
-
[tool.bandit]
|
|
6
|
-
skips = ["B105"]
|
|
7
|
-
|
|
8
|
-
[tool.isort]
|
|
9
|
-
profile = "black"
|
|
10
|
-
|
|
11
5
|
[tool.poetry]
|
|
12
6
|
authors = ["GrandMoff100 <minecraftcrusher100@gmail.com>"]
|
|
13
7
|
description = "Python Wrapper for Homeassistant's REST API"
|
|
@@ -18,51 +12,46 @@ name = "HomeAssistant-API"
|
|
|
18
12
|
readme = "README.md"
|
|
19
13
|
include = ["homeassistant_api/py.typed"]
|
|
20
14
|
repository = "https://github.com/GrandMoff100/HomeAssistantAPI"
|
|
21
|
-
version = "4.
|
|
15
|
+
version = "4.1.0"
|
|
22
16
|
packages = [{ include = "homeassistant_api" }]
|
|
23
17
|
|
|
24
18
|
[tool.poetry.dependencies]
|
|
25
19
|
aiohttp = "^3.8.1"
|
|
26
20
|
aiohttp-client-cache = "^0.6.1"
|
|
27
21
|
pydantic = "<=1.9.0"
|
|
28
|
-
python = "
|
|
29
|
-
requests = "2.27.1"
|
|
22
|
+
python = "^3.7,<4.0.0"
|
|
23
|
+
requests = "^2.27.1"
|
|
30
24
|
requests-cache = "^0.9.2"
|
|
31
25
|
simplejson = "^3.17.6"
|
|
32
26
|
|
|
33
|
-
[tool.poetry.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
[tool.poetry.group.docs]
|
|
28
|
+
optional = true
|
|
29
|
+
|
|
30
|
+
[tool.poetry.group.docs.dependencies]
|
|
31
|
+
sphinx-autodoc-typehints = "^1.17.0"
|
|
32
|
+
sphinx-rtd-theme = "^1.0.0"
|
|
33
|
+
autodoc-pydantic = "^1.6.1"
|
|
34
|
+
|
|
35
|
+
[tool.poetry.group.styling]
|
|
36
|
+
optional = true
|
|
37
|
+
|
|
38
|
+
[tool.poetry.group.styling.dependencies]
|
|
37
39
|
pre-commit = "^2.17.0"
|
|
38
|
-
pylint = "^2.12.2"
|
|
39
|
-
pytest = "^6.2.5"
|
|
40
|
-
sphinx-autodoc-typehints = {version = "^1.17.0", extras = ["docs"]}
|
|
41
|
-
sphinx-rtd-theme = {version = "^1.0.0", extras = ["docs"]}
|
|
42
|
-
toml = "^0.10.2"
|
|
43
40
|
types-docutils = "^0.17.5"
|
|
44
41
|
types-requests = "^2.27.9"
|
|
45
42
|
types-simplejson = "^3.17.3"
|
|
46
43
|
types-toml = "^0.10.4"
|
|
47
44
|
mypy = "^0.931"
|
|
48
|
-
|
|
49
|
-
pytest-asyncio = "^0.18.3"
|
|
50
|
-
pytest-cov = "^3.0.0"
|
|
51
|
-
coverage = {extras = ["toml"], version = "^6.4.1"}
|
|
52
|
-
aiosqlite = "^0.17.0"
|
|
45
|
+
ruff = "^0.0.209"
|
|
53
46
|
|
|
54
|
-
[tool.
|
|
55
|
-
|
|
56
|
-
ignore-paths = ["examples"]
|
|
57
|
-
|
|
58
|
-
[tool.pylint.messages_control]
|
|
59
|
-
disable = [
|
|
60
|
-
"duplicate-code",
|
|
61
|
-
"too-many-public-methods",
|
|
62
|
-
"too-many-arguments",
|
|
63
|
-
"protected-access"
|
|
64
|
-
]
|
|
47
|
+
[tool.poetry.group.testing]
|
|
48
|
+
optional = true
|
|
65
49
|
|
|
50
|
+
[tool.poetry.group.testing.dependencies]
|
|
51
|
+
pytest-asyncio = "^0.18.3"
|
|
52
|
+
pytest-cov = "^3.0.0"
|
|
53
|
+
pytest = "^6.2.5"
|
|
54
|
+
aiosqlite = "^0.18.0"
|
|
66
55
|
|
|
67
56
|
[tool.pytest.ini_options]
|
|
68
57
|
asyncio_mode = "auto"
|
|
@@ -81,3 +70,20 @@ exclude_lines = [
|
|
|
81
70
|
"last_updated < \\(now := datetime\\.now\\(\\)\\) - wait",
|
|
82
71
|
"pragma: no cover"
|
|
83
72
|
]
|
|
73
|
+
|
|
74
|
+
[tool.ruff]
|
|
75
|
+
exclude = [
|
|
76
|
+
'.git',
|
|
77
|
+
'__pycache__',
|
|
78
|
+
'.github',
|
|
79
|
+
]
|
|
80
|
+
ignore = ['E501']
|
|
81
|
+
select = [
|
|
82
|
+
'E',
|
|
83
|
+
'F',
|
|
84
|
+
'W',
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
[tool.ruff.per-file-ignores]
|
|
88
|
+
"__init__.py" = ['F401']
|
|
89
|
+
"conf.py" = ['E402']
|
|
@@ -12,23 +12,23 @@ install_requires = \
|
|
|
12
12
|
'aiohttp>=3.8.1,<4.0.0',
|
|
13
13
|
'pydantic<=1.9.0',
|
|
14
14
|
'requests-cache>=0.9.2,<0.10.0',
|
|
15
|
-
'requests
|
|
15
|
+
'requests>=2.27.1,<3.0.0',
|
|
16
16
|
'simplejson>=3.17.6,<4.0.0']
|
|
17
17
|
|
|
18
18
|
setup_kwargs = {
|
|
19
19
|
'name': 'homeassistant-api',
|
|
20
|
-
'version': '4.
|
|
20
|
+
'version': '4.1.0',
|
|
21
21
|
'description': "Python Wrapper for Homeassistant's REST API",
|
|
22
|
-
'long_description': '# HomeassistantAPI\n\n[](https://codecov.io/gh/GrandMoff100/HomeAssistantAPI)\n[](https://pypi.org/project/homeassistant_api)\n\n[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)\n[](https://github.com/GrandMoff100/HomeassistantAPI/releases)\n\n
|
|
22
|
+
'long_description': '# HomeassistantAPI\n\n[](https://codecov.io/gh/GrandMoff100/HomeAssistantAPI)\n[](https://pypi.org/project/homeassistant_api)\n\n[](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)\n[](https://github.com/GrandMoff100/HomeassistantAPI/releases)\n\n<a href="https://home-assistant.io">\n <img src="https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true" width="60%">\n</a>\n\n## Python wrapper for Homeassistant\'s [REST API](https://developers.home-assistant.io/docs/api/rest/)\n\nHere is a quick example.\n\n```py\nfrom homeassistant_api import Client\n\nwith Client(\n \'<API Server URL>\',\n \'<Your Long Lived Access-Token>\'\n) as client:\n\n light = client.get_domain("light")\n\n light.turn_on(entity_id="light.living_room_lamp")\n```\n\nAll the methods also support async!\n\n## Documentation\n\nAll documentation, API reference, contribution guidelines and pretty much everything else\nyou\'d want to know is on our readthedocs site [here](https://homeassistantapi.readthedocs.io)\n\nIf there is something missing, open an issue and let us know! Thanks!\n\nGo make some cool stuff! Maybe come back and tell us about it in a\n[discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)?\nWe\'d love to hear about how you use our library!!\n\n## License\n\nThis project is under the GNU GPLv3 license, as defined by the Free Software Foundation.\n',
|
|
23
23
|
'author': 'GrandMoff100',
|
|
24
24
|
'author_email': 'minecraftcrusher100@gmail.com',
|
|
25
|
-
'maintainer': None,
|
|
26
|
-
'maintainer_email': None,
|
|
25
|
+
'maintainer': 'None',
|
|
26
|
+
'maintainer_email': 'None',
|
|
27
27
|
'url': 'https://github.com/GrandMoff100/HomeAssistantAPI',
|
|
28
28
|
'packages': packages,
|
|
29
29
|
'package_data': package_data,
|
|
30
30
|
'install_requires': install_requires,
|
|
31
|
-
'python_requires': '>=3.7,<4.0
|
|
31
|
+
'python_requires': '>=3.7,<4.0',
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/domains.py
RENAMED
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/entity.py
RENAMED
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/events.py
RENAMED
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/history.py
RENAMED
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/models/logbook.py
RENAMED
|
File without changes
|
|
File without changes
|
{HomeAssistant-API-4.0.0.post2 → homeassistant_api-4.1.0}/homeassistant_api/rawbaseclient.py
RENAMED
|
File without changes
|