@@ -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(' 127.1 .0.1' , ' password' )
21
+ api = remote.API(' 127.0 .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(' 127.1 .0.1' , ' password' )
30
+ api = remote.API(' 127.0 .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 @@ Get the current configuration of a Home Asssitant instance.
40
40
``` python
41
41
import homeassistant.remote as remote
42
42
43
- api = remote.API(' 127.1 .0.1' , ' password' )
43
+ api = remote.API(' 127.0 .0.1' , ' password' )
44
44
45
45
print (remote.get_config(api))
46
46
```
@@ -52,7 +52,7 @@ Similar to the output in the "Developer Tools" of the frontend.
52
52
``` python
53
53
import homeassistant.remote as remote
54
54
55
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
55
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
56
56
57
57
print (' -- Available services:' )
58
58
services = remote.get_services(api)
@@ -77,7 +77,7 @@ To get the details of a single entity the `get_state` method is used.
77
77
``` python
78
78
import homeassistant.remote as remote
79
79
80
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
80
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
81
81
office_temperature = remote.get_state(api, ' sensor.office_temperature' )
82
82
print (' {} is {} {} .' .format(office_temperature.attributes[' friendly_name' ],
83
83
office_temperature.state,
@@ -97,7 +97,7 @@ The exact same thing is working for a switch. The difference is that both entiti
97
97
``` python
98
98
import homeassistant.remote as remote
99
99
100
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
100
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
101
101
switch_livingroom = remote.get_state(api, ' switch.livingroom_pin_2' )
102
102
print (' {} is {} .' .format(switch_livingroom.attributes[' friendly_name' ],
103
103
switch_livingroom.state
@@ -113,7 +113,7 @@ Of course, it's possible to set the state.
113
113
import homeassistant.remote as remote
114
114
from homeassistant.const import STATE_ON
115
115
116
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
116
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
117
117
remote.set_state(api, ' sensor.office_temperature' , new_state = 123 )
118
118
remote.set_state(api, ' switch.livingroom_pin_2' , new_state = STATE_ON )
119
119
```
@@ -129,7 +129,7 @@ If you want to turn on all entities of a domain, just use a service which was re
129
129
import time
130
130
import homeassistant.remote as remote
131
131
132
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
132
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
133
133
domain = ' switch'
134
134
135
135
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.
145
145
import time
146
146
import homeassistant.remote as remote
147
147
148
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
148
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
149
149
domain = ' switch'
150
150
switch_name = ' switch.livingroom_pin_2'
151
151
@@ -185,7 +185,7 @@ The example uses the jabber notification platform to send a single message to th
185
185
``` python
186
186
import homeassistant.remote as remote
187
187
188
- api = remote.API(' 127.1 .0.1' , ' YOUR_PASSWORD' )
188
+ api = remote.API(' 127.0 .0.1' , ' YOUR_PASSWORD' )
189
189
domain = ' notify'
190
190
data = {" title" :" Test" , " message" :" A simple test message from HA." }
191
191
0 commit comments