Skip to content

Commit 0fa35c9

Browse files
committed
Use 127.0.0.1
1 parent cfac236 commit 0fa35c9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

source/developers/python_api.markdown

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ First import the module and setup the basics.
1818
```python
1919
import homeassistant.remote as remote
2020

21-
api = remote.API('127.1.0.1', 'password')
21+
api = remote.API('127.0.0.1', 'password')
2222
print(remote.validate_api(api))
2323
```
2424

@@ -27,7 +27,7 @@ This snippets shows how to use the `homeassistant.remote` package in another way
2727
```python
2828
import homeassistant.remote as remote
2929

30-
api = remote.API('127.1.0.1', 'password')
30+
api = remote.API('127.0.0.1', 'password')
3131
hass = remote.HomeAssistant(api)
3232
hass.start()
3333
living_room = hass.states.get('group.living_room')
@@ -40,7 +40,7 @@ Get the current configuration of a Home Asssitant instance.
4040
```python
4141
import homeassistant.remote as remote
4242

43-
api = remote.API('127.1.0.1', 'password')
43+
api = remote.API('127.0.0.1', 'password')
4444

4545
print(remote.get_config(api))
4646
```
@@ -52,7 +52,7 @@ Similar to the output in the "Developer Tools" of the frontend.
5252
```python
5353
import homeassistant.remote as remote
5454

55-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
55+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
5656

5757
print('-- Available services:')
5858
services = remote.get_services(api)
@@ -77,7 +77,7 @@ To get the details of a single entity the `get_state` method is used.
7777
```python
7878
import homeassistant.remote as remote
7979

80-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
80+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
8181
office_temperature = remote.get_state(api, 'sensor.office_temperature')
8282
print('{} is {} {}.'.format(office_temperature.attributes['friendly_name'],
8383
office_temperature.state,
@@ -97,7 +97,7 @@ The exact same thing is working for a switch. The difference is that both entiti
9797
```python
9898
import homeassistant.remote as remote
9999

100-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
100+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
101101
switch_livingroom = remote.get_state(api, 'switch.livingroom_pin_2')
102102
print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'],
103103
switch_livingroom.state
@@ -113,7 +113,7 @@ Of course, it's possible to set the state.
113113
import homeassistant.remote as remote
114114
from homeassistant.const import STATE_ON
115115

116-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
116+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
117117
remote.set_state(api, 'sensor.office_temperature', new_state=123)
118118
remote.set_state(api, 'switch.livingroom_pin_2', new_state=STATE_ON)
119119
```
@@ -129,7 +129,7 @@ If you want to turn on all entities of a domain, just use a service which was re
129129
import time
130130
import homeassistant.remote as remote
131131

132-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
132+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
133133
domain = 'switch'
134134

135135
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.
145145
import time
146146
import homeassistant.remote as remote
147147

148-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
148+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
149149
domain = 'switch'
150150
switch_name = 'switch.livingroom_pin_2'
151151

@@ -185,7 +185,7 @@ The example uses the jabber notification platform to send a single message to th
185185
```python
186186
import homeassistant.remote as remote
187187

188-
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
188+
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
189189
domain = 'notify'
190190
data = {"title":"Test", "message":"A simple test message from HA."}
191191

0 commit comments

Comments
 (0)