@@ -18,7 +18,7 @@ First import the module and setup the basics.
18
18
``` python
19
19
import homeassistant.remote as remote
20
20
21
- api = remote.API(' host ' , ' password' )
21
+ api = remote.API(' 127.1.0.1 ' , ' password' )
22
22
print (remote.validate_api(api))
23
23
```
24
24
@@ -27,7 +27,7 @@ This snippets shows how to use the `homeassistant.remote` package in another way
27
27
``` python
28
28
import homeassistant.remote as remote
29
29
30
- api = remote.API(' host ' , ' password' )
30
+ api = remote.API(' 127.1.0.1 ' , ' password' )
31
31
hass = remote.HomeAssistant(api)
32
32
hass.start()
33
33
living_room = hass.states.get(' group.living_room' )
@@ -40,7 +40,7 @@ Similar to the output in the "Developer Tools" of the frontend.
40
40
``` python
41
41
import homeassistant.remote as remote
42
42
43
- api = remote.API(' host ' , ' password' )
43
+ api = remote.API(' 127.1.0.1 ' , ' password' )
44
44
45
45
print (' -- Available services:' )
46
46
services = remote.get_services(api)
@@ -60,7 +60,7 @@ To get the details of a single entity the `get_state` method is used.
60
60
``` python
61
61
import homeassistant.remote as remote
62
62
63
- api = remote.API(' host ' , ' password' )
63
+ api = remote.API(' 127.1.0.1 ' , ' password' )
64
64
office_temperature = remote.get_state(api, ' sensor.office_temperature' )
65
65
print (' {} is {} {} .' .format(office_temperature.attributes[' friendly_name' ],
66
66
office_temperature.state,
@@ -80,7 +80,7 @@ The exact same thing is working for a switch. The difference is that both entiti
80
80
``` python
81
81
import homeassistant.remote as remote
82
82
83
- api = remote.API(' host ' , ' password' )
83
+ api = remote.API(' 127.1.0.1 ' , ' password' )
84
84
switch_livingroom = remote.get_state(api, ' switch.livingroom_pin_2' )
85
85
print (' {} is {} .' .format(switch_livingroom.attributes[' friendly_name' ],
86
86
switch_livingroom.state
@@ -96,7 +96,7 @@ Of course, it's possible to set the state.
96
96
import homeassistant.remote as remote
97
97
from homeassistant.const import STATE_ON
98
98
99
- api = remote.API(' host ' , ' password' )
99
+ api = remote.API(' 127.1.0.1 ' , ' password' )
100
100
remote.set_state(api, ' sensor.office_temperature' , new_state = 123 )
101
101
remote.set_state(api, ' switch.livingroom_pin_2' , new_state = STATE_ON )
102
102
```
@@ -112,7 +112,7 @@ If you want to turn on all entities of a domain, just a service which was retrie
112
112
import time
113
113
import homeassistant.remote as remote
114
114
115
- api = remote.API(' host ' , ' password' )
115
+ api = remote.API(' 127.1.0.1 ' , ' password' )
116
116
domain = ' switch'
117
117
118
118
remote.call_service(api, domain, ' turn_on' )
@@ -128,7 +128,7 @@ To turn on or off a single switch. The ID of the entity is needed as attribute.
128
128
import time
129
129
import homeassistant.remote as remote
130
130
131
- api = remote.API(' host ' , ' password' )
131
+ api = remote.API(' 127.1.0.1 ' , ' password' )
132
132
domain = ' switch'
133
133
switch_name = ' switch.livingroom_pin_2'
134
134
@@ -144,7 +144,7 @@ The example uses the jabber notification platform to send a single message to th
144
144
``` python
145
145
import homeassistant.remote as remote
146
146
147
- api = remote.API(' host ' , ' password' )
147
+ api = remote.API(' 127.1.0.1 ' , ' password' )
148
148
domain = ' notify'
149
149
data = {" title" :" Test" , " message" :" A simple test message from HA." }
150
150
0 commit comments