Merge remote-tracking branch 'origin/master' into next

Conflicts:
	source/_posts/2016-07-16-sqlalchemy-knx-join-simplisafe.markdown
This commit is contained in:
Paulus Schoutsen 2016-07-30 11:29:05 -07:00
commit fb2ea42c88
39 changed files with 736 additions and 49 deletions

View file

@ -52,19 +52,19 @@ Similar to the output in the "Developer Tools" of the frontend.
```python
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
print('-- Available services:')
services = remote.get_services(api)
for service in services:
print(service['services'])
print('\n-- Available event')
print('\n-- Available events:')
events = remote.get_event_listeners(api)
for event in events:
print(event)
print('\n-- Available entities')
print('\n-- Available entities:')
entities = remote.get_states(api)
for entity in entities:
print(entity)
@ -77,7 +77,7 @@ To get the details of a single entity the `get_state` method is used.
```python
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
office_temperature = remote.get_state(api, 'sensor.office_temperature')
print('{} is {} {}.'.format(office_temperature.attributes['friendly_name'],
office_temperature.state,
@ -97,7 +97,7 @@ The exact same thing is working for a switch. The difference is that both entiti
```python
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
switch_livingroom = remote.get_state(api, 'switch.livingroom_pin_2')
print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'],
switch_livingroom.state
@ -113,7 +113,7 @@ Of course, it's possible to set the state.
import homeassistant.remote as remote
from homeassistant.const import STATE_ON
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
remote.set_state(api, 'sensor.office_temperature', new_state=123)
remote.set_state(api, 'switch.livingroom_pin_2', new_state=STATE_ON)
```
@ -122,14 +122,14 @@ The state will be set to those value until the next update occurs.
### {% linkable_title Blinking all entites of a domain %}
If you want to turn on all entities of a domain, just a service which was retrieved by `get_services`.
If you want to turn on all entities of a domain, just use a service which was retrieved by `get_services`.
```python
import time
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
domain = 'switch'
remote.call_service(api, domain, 'turn_on')
@ -145,7 +145,7 @@ To turn on or off a single switch. The ID of the entity is needed as attribute.
import time
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
domain = 'switch'
switch_name = 'switch.livingroom_pin_2'
@ -185,7 +185,7 @@ The example uses the jabber notification platform to send a single message to th
```python
import homeassistant.remote as remote
api = remote.API('127.1.0.1', 'password')
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
domain = 'notify'
data = {"title":"Test", "message":"A simple test message from HA."}