mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Update slave instructions
This commit is contained in:
parent
d10adaee89
commit
0a8bc2038d
@ -100,13 +100,17 @@ A slave instance can be started with the following code and has the same support
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
import homeassistant.remote as remote
|
import homeassistant.remote as remote
|
||||||
import homeassistant.components.http as http
|
import homeassistant.bootstrap as bootstrap
|
||||||
|
|
||||||
remote_api = remote.API("remote_host_or_ip", "remote_api_password")
|
# Location of the Master API: host, password, port.
|
||||||
|
# Password and port are optional.
|
||||||
|
remote_api = remote.API("127.0.0.1", "password", 8124)
|
||||||
|
|
||||||
|
# Initialize slave
|
||||||
hass = remote.HomeAssistant(remote_api)
|
hass = remote.HomeAssistant(remote_api)
|
||||||
|
|
||||||
http.setup(hass, "my_local_api_password")
|
# To add an interface to the slave on localhost:8123
|
||||||
|
bootstrap.setup_component(hass, 'frontend')
|
||||||
|
|
||||||
hass.start()
|
hass.start()
|
||||||
hass.block_till_stopped()
|
hass.block_till_stopped()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user