Merge branch 'current' into next
This commit is contained in:
commit
8a8e6e9c1f
52 changed files with 304 additions and 108 deletions
|
@ -24,5 +24,11 @@ On Windows you can use `python setup.py develop` instead of the setup script.
|
|||
|
||||
After following these steps, running `hass` will invoke your local installation.
|
||||
|
||||
###Developing on Windows
|
||||
If you are using Windows as a development platform ensure you have the correct Microsoft Visual C++ build tools installed. Please check [the Windows Compilers](https://wiki.python.org/moin/WindowsCompilers) section on the [Python website](https://www.python.org/) for details. Validation using `tox` will fail if this is not done correctly.
|
||||
|
||||
Ensure you install or upgrade the Setuptools Python package. It contains compatibility improvements and adds automatic use of compilers:
|
||||
```bash
|
||||
pip install --upgrade setuptools
|
||||
```
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ The `hello.html` contains the needed building blocks to create the elements insi
|
|||
</template>
|
||||
</dom-module>
|
||||
|
||||
</script>
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'ha-panel-hello',
|
||||
properties: {
|
||||
|
@ -67,11 +67,10 @@ Create an entry for the new panel in your `configuration.yaml` file:
|
|||
|
||||
```yaml
|
||||
panel_custom:
|
||||
- name: hello_world
|
||||
- name: hello
|
||||
sidebar_title: Hello World
|
||||
sidebar_icon: mdi:hand-pointing-right
|
||||
url_path: hello_world
|
||||
webcomponent_path: <config dir>/panels/hello.html
|
||||
url_path: hello
|
||||
```
|
||||
|
||||
For more examples, see the [Custom panel Examples](/cookbook#custom-panel-examples) on our examples page.
|
||||
|
|
|
@ -15,3 +15,11 @@ Welcome to the Home Assistant development documentation. This is the place to le
|
|||
<img src='/images/architecture/component_interaction.png' alt='Diagram showing interaction between components and the Home Assistant core.'>
|
||||
Diagram showing interaction between components and the Home Assistant core.
|
||||
</p>
|
||||
|
||||
The best way to familiarize yourself with Home Assistant is to watch the PyCon 2016 talk about Home Assistant and read through the [Python API docs].
|
||||
|
||||
<div class='videoWrapper'>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/Cfasc9EgbMU" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
[Python API docs]: https://dev-docs.home-assistant.io
|
||||
|
|
42
source/developers/maintenance.markdown
Normal file
42
source/developers/maintenance.markdown
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
layout: page
|
||||
title: "Maintenance"
|
||||
description: "Steps involved to maintain the current state of Home Assistant."
|
||||
date: 2016-09-13 17:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
This page documents a couple of points for maintaining the Home Assistant code. Most of the tasks don't need to be performed on a regular base thus the steps, used tools, or details are preserved here.
|
||||
|
||||
### {% linkable_title Line separator %}
|
||||
|
||||
People are using various operating systems to develop components and platforms for Home Assistant. This could lead to different line endings on file. We prefer `LN`. Especially Microsoft Windows tools tend to use `CRLF`.
|
||||
|
||||
```bash
|
||||
$ find homeassistant -name "*.py" -exec file {} \; | grep BOM
|
||||
$ find homeassistant -name "*.py" -exec file {} \; | grep CRLF
|
||||
```
|
||||
|
||||
To fix the line spearator, use `dos2unix` or `sed`.
|
||||
|
||||
```bash
|
||||
$ dos2unix homeassistant/components/notify/kodi.py
|
||||
```
|
||||
|
||||
### {% linkable_title Dependencies %}
|
||||
|
||||
A lot of components and platforms depends on third-party Python modules. The dependencies which are stored in the `requirements_*.txt` files are tracked by [gemnasium](https://gemnasium.com/github.com/home-assistant/home-assistant) and [Requires.io](https://requires.io/github/home-assistant/home-assistant/requirements/?branch=dev).
|
||||
|
||||
If you update the requirements of a component/platform through the `REQUIREMENTS = ['modules-xyz==0.3']` entry, run the provided script to update the `requirements_*.txt` file(s).
|
||||
|
||||
```bash
|
||||
$ script/gen_requirements_all.py
|
||||
```
|
||||
|
||||
Start a test run of Home Assistant if that was successful include all files in a Pull Request. Add a short summary of the changes, a sample configuration entry, details about the tests, and other useful information to the description.
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
layout: page
|
||||
title: "Python API"
|
||||
description: "Home Assistant Python API documentation"
|
||||
title: "Python Remote API"
|
||||
description: "Home Assistant Python Remote API documentation"
|
||||
date: 2015-05-11 12:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
|
@ -18,7 +18,7 @@ First import the module and setup the basics.
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'password')
|
||||
api = remote.API('127.0.0.1', 'password')
|
||||
print(remote.validate_api(api))
|
||||
```
|
||||
|
||||
|
@ -27,7 +27,7 @@ This snippets shows how to use the `homeassistant.remote` package in another way
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'password')
|
||||
api = remote.API('127.0.0.1', 'password')
|
||||
hass = remote.HomeAssistant(api)
|
||||
hass.start()
|
||||
living_room = hass.states.get('group.living_room')
|
||||
|
@ -40,7 +40,7 @@ Get the current configuration of a Home Asssitant instance.
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'password')
|
||||
api = remote.API('127.0.0.1', 'password')
|
||||
|
||||
print(remote.get_config(api))
|
||||
```
|
||||
|
@ -52,7 +52,7 @@ Similar to the output in the "Developer Tools" of the frontend.
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
|
||||
print('-- Available services:')
|
||||
services = remote.get_services(api)
|
||||
|
@ -77,7 +77,7 @@ To get the details of a single entity the `get_state` method is used.
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
office_temperature = remote.get_state(api, 'sensor.office_temperature')
|
||||
print('{} is {} {}.'.format(office_temperature.attributes['friendly_name'],
|
||||
office_temperature.state,
|
||||
|
@ -97,7 +97,7 @@ The exact same thing is working for a switch. The difference is that both entiti
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
switch_livingroom = remote.get_state(api, 'switch.livingroom_pin_2')
|
||||
print('{} is {}.'.format(switch_livingroom.attributes['friendly_name'],
|
||||
switch_livingroom.state
|
||||
|
@ -113,7 +113,7 @@ Of course, it's possible to set the state.
|
|||
import homeassistant.remote as remote
|
||||
from homeassistant.const import STATE_ON
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
remote.set_state(api, 'sensor.office_temperature', new_state=123)
|
||||
remote.set_state(api, 'switch.livingroom_pin_2', new_state=STATE_ON)
|
||||
```
|
||||
|
@ -129,7 +129,7 @@ If you want to turn on all entities of a domain, just use a service which was re
|
|||
import time
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
domain = 'switch'
|
||||
|
||||
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.
|
|||
import time
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
domain = 'switch'
|
||||
switch_name = 'switch.livingroom_pin_2'
|
||||
|
||||
|
@ -185,7 +185,7 @@ The example uses the jabber notification platform to send a single message to th
|
|||
```python
|
||||
import homeassistant.remote as remote
|
||||
|
||||
api = remote.API('127.1.0.1', 'YOUR_PASSWORD')
|
||||
api = remote.API('127.0.0.1', 'YOUR_PASSWORD')
|
||||
domain = 'notify'
|
||||
data = {"title":"Test", "message":"A simple test message from HA."}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ This page describes the steps for publishing a new Home Assistant release.
|
|||
1. Create a pull request from `dev` to `master` with the upcoming release number as title.
|
||||
2. Merge `master` into `dev` to make the PR mergable. PR message contains intro, highlighting major changes, and an overview of all changes tagging each author.
|
||||
3. Update `homeassistant/const.py` with the correct version number (remove the the `dev` tag) and push that commit.
|
||||
4. Merge pull request.
|
||||
4. Merge pull request (DO NOT SQUASH!).
|
||||
5. Then, after merged, push another update to `dev` of `homeassistant/const.py` that includes the next version with the `dev` tag. Add a meaningful commit message like "Version bump to X". This commit acts as marker for the next release.
|
||||
6. Go to [releases](https://github.com/home-assistant/home-assistant/releases) and tag a new release on the `master` branch. "Tag version" and "Release title" are the version number (`O.x` for major version, `0.x.y` for minor and bug fix releases). Release description is the text from PR. Press "Publish release" to finish the process.
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ print(response.text)
|
|||
```
|
||||
|
||||
<p class='note'>
|
||||
You can append `?password=YOUR_PASSWORD` to any url to log in automatically.
|
||||
You can append `?api_password=YOUR_PASSWORD` to any url to log in automatically.
|
||||
</p>
|
||||
|
||||
Successful calls will return status code 200 or 201. Other status codes that can return are:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue