@@ -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(' 127.1.0.1' , ' password ' )
43
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
44
44
45
45
print (' -- Available services:' )
46
46
services = remote.get_services(api)
@@ -65,7 +65,7 @@ To get the details of a single entity the `get_state` method is used.
65
65
``` python
66
66
import homeassistant.remote as remote
67
67
68
- api = remote.API(' 127.1.0.1' , ' password ' )
68
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
69
69
office_temperature = remote.get_state(api, ' sensor.office_temperature' )
70
70
print (' {} is {} {} .' .format(office_temperature.attributes[' friendly_name' ],
71
71
office_temperature.state,
@@ -85,7 +85,7 @@ The exact same thing is working for a switch. The difference is that both entiti
85
85
``` python
86
86
import homeassistant.remote as remote
87
87
88
- api = remote.API(' 127.1.0.1' , ' password ' )
88
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
89
89
switch_livingroom = remote.get_state(api, ' switch.livingroom_pin_2' )
90
90
print (' {} is {} .' .format(switch_livingroom.attributes[' friendly_name' ],
91
91
switch_livingroom.state
@@ -101,7 +101,7 @@ Of course, it's possible to set the state.
101
101
import homeassistant.remote as remote
102
102
from homeassistant.const import STATE_ON
103
103
104
- api = remote.API(' 127.1.0.1' , ' password ' )
104
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
105
105
remote.set_state(api, ' sensor.office_temperature' , new_state = 123 )
106
106
remote.set_state(api, ' switch.livingroom_pin_2' , new_state = STATE_ON )
107
107
```
@@ -117,7 +117,7 @@ If you want to turn on all entities of a domain, just use a service which was re
117
117
import time
118
118
import homeassistant.remote as remote
119
119
120
- api = remote.API(' 127.1.0.1' , ' password ' )
120
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
121
121
domain = ' switch'
122
122
123
123
remote.call_service(api, domain, ' turn_on' )
@@ -133,7 +133,7 @@ To turn on or off a single switch. The ID of the entity is needed as attribute.
133
133
import time
134
134
import homeassistant.remote as remote
135
135
136
- api = remote.API(' 127.1.0.1' , ' password ' )
136
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
137
137
domain = ' switch'
138
138
switch_name = ' switch.livingroom_pin_2'
139
139
@@ -149,7 +149,7 @@ The example uses the jabber notification platform to send a single message to th
149
149
``` python
150
150
import homeassistant.remote as remote
151
151
152
- api = remote.API(' 127.1.0.1' , ' password ' )
152
+ api = remote.API(' 127.1.0.1' , ' YOUR_PASSWORD ' )
153
153
domain = ' notify'
154
154
data = {" title" :" Test" , " message" :" A simple test message from HA." }
155
155
0 commit comments