mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
move python api to a separate page
This commit is contained in:
parent
acd1c7893c
commit
e92b5dc6e4
31
source/developers/python_api.markdown
Normal file
31
source/developers/python_api.markdown
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Python API"
|
||||
description: "Home Assistant Python API documentation"
|
||||
date: 2015-05-11 12:00
|
||||
sidebar: false
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
In the package [`homeassistant.remote`](https://github.com/balloob/home-assistant/blob/master/homeassistant/remote.py) a Python API on top of the [HTTP API](/developers/api.html) can be found.
|
||||
|
||||
The two snippets below shows how to use the `homeassistant.remote` package:
|
||||
|
||||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API("host", "password")
|
||||
living_room = remote.get_state(api, 'group.living_room')
|
||||
```
|
||||
|
||||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API("host", "password")
|
||||
hass = remote.HomeAssistant(api)
|
||||
hass.start()
|
||||
living_room = hass.states.get('group.living_room')
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user