You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/developers/python_api.markdown
+6-17Lines changed: 6 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,11 @@ sharing: true
9
9
footer: true
10
10
---
11
11
12
-
In the package [`homeassistant.remote`](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/remote.py) a Python API on top of the [HTTP API](/developers/api/) can be found.
12
+
See the [developer documentation][devdocs] for a full overview of the documentation. The rest of this page will contain examples on how to use it.
Note: This page is not full documentation for this API, but a collection of examples showing its use.
16
+
In the package [`homeassistant.remote`](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/remote.py) a Python API on top of the [HTTP API](/developers/api/) can be found.
15
17
16
18
A simple way to get all current entities is to visit the "Set State" page in the "Developer Tools". For the examples below just choose one from the available entries. Here the sensor `sensor.office_temperature` and the switch `switch.livingroom_pin_2` are used.
17
19
@@ -24,17 +26,6 @@ api = remote.API('127.0.0.1', 'password')
24
26
print(remote.validate_api(api))
25
27
```
26
28
27
-
Here's another way to use the `homeassistant.remote` package:
print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'],
95
+
print('{} is {}.'.format(switch_livingroom.name,
105
96
switch_livingroom.state
106
97
)
107
98
)
@@ -193,5 +184,3 @@ data = {"title":"Test", "message":"A simple test message from HA."}
193
184
194
185
remote.call_service(api, domain, 'jabber', data)
195
186
```
196
-
197
-
For more details, please check the source of [homeassistant.remote](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/remote.py).
0 commit comments