|
6 | 6 | import functools |
7 | 7 | import json |
8 | 8 | import ssl |
9 | | -import time |
10 | 9 | from collections.abc import AsyncGenerator, Iterable |
11 | 10 | from copy import deepcopy |
12 | 11 | from dataclasses import dataclass, field |
@@ -810,11 +809,11 @@ async def safe_delete(self: "HassPlugin"): |
810 | 809 | @utils.warning_decorator(error_text="Unexpected error while getting hass state") |
811 | 810 | async def get_complete_state(self) -> dict[str, dict[str, Any]] | None: |
812 | 811 | """Required method for all AppDaemon plugins. |
813 | | - |
| 812 | +
|
814 | 813 | Uses the ``/api/states`` endpoint of the `REST API <https://developers.home-assistant.io/docs/api/rest>`_ to |
815 | 814 | get an array of state objects. Each state has the following attributes: `entity_id`, `state`, `last_changed` and |
816 | 815 | `attributes`. |
817 | | - |
| 816 | +
|
818 | 817 | The API natively returns the result as a list of dicts, but this turns the result into a single dict based on |
819 | 818 | `entity_id` to match what AppDaemon needs from this method. |
820 | 819 | """ |
@@ -908,7 +907,7 @@ async def get_history( |
908 | 907 | filter_entity_id (str, Iterable[str]): Filter on one or more entities. |
909 | 908 | timestamp (datetime, optional): Determines the beginning of the period. Defaults to 1 day before the time of |
910 | 909 | the request. |
911 | | - end_time (datetime, optional): |
| 910 | + end_time (datetime, optional): |
912 | 911 | minimal_response (bool, optional): Only return last_changed and state for states other than the first and |
913 | 912 | last state (much faster). Defaults to `False` |
914 | 913 | no_attributes (bool, optional): Skip returning attributes from the database (much faster). |
@@ -1004,7 +1003,7 @@ async def render_template(self, namespace: str, template: str, **kwargs) -> str |
1004 | 1003 | `REST API <https://developers.home-assistant.io/docs/api/rest>`_. |
1005 | 1004 |
|
1006 | 1005 | See the `template docs <https://www.home-assistant.io/docs/configuration/templating>`_ for more information. |
1007 | | - |
| 1006 | +
|
1008 | 1007 | If successful, this returns a str of the raw response. It should still be processed downstream with |
1009 | 1008 | :py:func:`~ast.literal_eval`, which will turn the result into its real type. |
1010 | 1009 | """ |
|
0 commit comments