move python api to a separate page

This commit is contained in:
Fabian Affolter 2015-05-11 12:07:06 +02:00
parent acd1c7893c
commit e92b5dc6e4

View 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')
```