From e92b5dc6e4bcfdfe433d5b1e9f024a9f0fee4990 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 11 May 2015 12:07:06 +0200 Subject: [PATCH] move python api to a separate page --- source/developers/python_api.markdown | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 source/developers/python_api.markdown diff --git a/source/developers/python_api.markdown b/source/developers/python_api.markdown new file mode 100644 index 00000000000..8c91fb2c021 --- /dev/null +++ b/source/developers/python_api.markdown @@ -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') +``` +