diff --git a/atom.xml b/atom.xml index f6a5083f89..58d3171bb2 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
In the package homeassistant.remote
a Python API on top of the HTTP API can be found.
Note: This page is not full documentation for this API, but a collection of examples showing its use.
+See the developer documentation for a full overview of the documentation. The rest of this page will contain examples on how to use it.
+In the package homeassistant.remote
a Python API on top of the HTTP API can be found.
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.
First import the module and setup the basics:
import homeassistant.remote as remote
@@ -76,15 +76,6 @@
print(remote.validate_api(api))
Here’s another way to use the homeassistant.remote
package:
import homeassistant.remote as remote
-
-api = remote.API('127.0.0.1', 'password')
-hass = remote.HomeAssistant(api)
-hass.start()
-living_room = hass.states.get('group.living_room')
-
-Get the current configuration of a Home Assistant instance:
import homeassistant.remote as remote
@@ -122,7 +113,7 @@
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
office_temperature = remote.get_state(api, 'sensor.office_temperature')
-print('{} is {} {}.'.format(office_temperature.attributes['friendly_name'],
+print('{} is {} {}.'.format(office_temperature.name,
office_temperature.state,
office_temperature.attributes['unit_of_measurement']
)
@@ -138,7 +129,7 @@
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
switch_livingroom = remote.get_state(api, 'switch.livingroom_pin_2')
-print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'],
+print('{} is {}.'.format(switch_livingroom.name,
switch_livingroom.state
)
)
@@ -214,7 +205,6 @@ longer timeout.
remote.call_service(api, domain, 'jabber', data)
For more details, please check the source of homeassistant.remote.