Make titles linkable

This commit is contained in:
Fabian Affolter 2016-12-18 10:40:27 +01:00
parent bbe7891c4a
commit a5fda6c17f
No known key found for this signature in database
GPG Key ID: E23CD2DD36A4397F
7 changed files with 378 additions and 380 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ class = HelloWorld
The `#Apps` section is the configuration for the Hello World program and should be left in place for initial testing but can be removed later if desired, as other Apps are added, App configuration is described in the [API doc](API.md). The `#Apps` section is the configuration for the Hello World program and should be left in place for initial testing but can be removed later if desired, as other Apps are added, App configuration is described in the [API doc](API.md).
## Docker ## {% linkable_title Docker %}
For Docker Configuration you need to take a couple of extra things into consideration. For Docker Configuration you need to take a couple of extra things into consideration.
@ -77,4 +77,4 @@ elevation = <elevation
timezone = <timezone> timezone = <timezone>
``` ```
You can run Docker and point the conf volume to that directory. You can run Docker and point the conf volume to that directory.

View File

@ -11,9 +11,9 @@ regenerate: true
hide_github_edit: true hide_github_edit: true
--- ---
Installation is either by pip3 or Docker. Installation is either by `pip3` or Docker.
## Clone the Repository ## {% linkable_title Clone the Repository %}
For either method you will need to clone the **AppDaemon** repository to the current local directory on your machine. For either method you will need to clone the **AppDaemon** repository to the current local directory on your machine.
@ -27,7 +27,7 @@ Change your working directory to the repository root. Moving forward, we will be
$ cd appdaemon $ cd appdaemon
``` ```
## Install using Docker ## {% linkable_title Install using Docker %}
To build the Docker image run the following: To build the Docker image run the following:
@ -37,7 +37,7 @@ $ docker build -t appdaemon .
(Note the period at the end of the above command) (Note the period at the end of the above command)
## Install Using PIP3 ## {% linkable_title Install using `pip3` %}
Before running `AppDaemon` you will need to install the package: Before running `AppDaemon` you will need to install the package:

View File

@ -11,4 +11,4 @@ regenerate: true
hide_github_edit: true hide_github_edit: true
--- ---
Since AppDaemon under the covers uses the exact same APIs as the frontend UI, you typically see it react at about the same time to a given event. Calling back to Home Assistant is also pretty fast especially if they are running on the same machine. In action, observed latency above the built in automation component is usually sub-second. Since `AppDaemon` under the covers uses the exact same APIs as the frontend UI, you typically see it react at about the same time to a given event. Calling back to Home Assistant is also pretty fast especially if they are running on the same machine. In action, observed latency above the built in automation component is usually sub-second.

View File

@ -11,9 +11,9 @@ regenerate: true
hide_github_edit: true hide_github_edit: true
--- ---
As configured, AppDaemon comes with a single HelloWorld App that will send a greeting to the logfile to show that everything is working correctly. As configured, `AppDaemon` comes with a single HelloWorld App that will send a greeting to the logfile to show that everything is working correctly.
## Docker ## {% linkable_title Docker %}
Assuming you have set the config up as described above for Docker, you can run it with the command: Assuming you have set the config up as described above for Docker, you can run it with the command:
@ -42,7 +42,7 @@ $ docker logs appdaemon
Note that for Docker, the error and regular logs are combined. Note that for Docker, the error and regular logs are combined.
## PIP3 ## {% linkable_title `pip3` %}
You can then run AppDaemon from the command line as follows: You can then run AppDaemon from the command line as follows:
@ -61,7 +61,7 @@ $ appdaemon -c conf/appdaemon.cfg
2016-08-22 10:08:16,584 INFO You are now ready to run Apps! 2016-08-22 10:08:16,584 INFO You are now ready to run Apps!
``` ```
## AppDaemon arguments ## {% linkable_title AppDaemon arguments %}
``` ```
usage: appdaemon [-h] [-c CONFIG] [-p PIDFILE] [-t TICK] [-s STARTTIME] usage: appdaemon [-h] [-c CONFIG] [-p PIDFILE] [-t TICK] [-s STARTTIME]
@ -87,8 +87,8 @@ optional arguments:
-d, --daemon run as a background process -d, --daemon run as a background process
``` ```
-c is the path to the configuration file. If not specified, AppDaemon will look for a file named `appdaemon.cfg` first in `~/.homeassistant` then in `/etc/appdaemon`. If the file is not specified and it is not found in either location, AppDaemon will raise an exception. -c is the path to the configuration file. If not specified, AppDaemon will look for a file named `appdaemon.cfg` first in `~/.homeassistant` then in `/etc/appdaemon`. If the file is not specified and it is not found in either location, AppDaemon will raise an exception.
-d and -p are used by the init file to start the process as a daemon and are not required if running from the command line. -d and -p are used by the init file to start the process as a daemon and are not required if running from the command line.
-D can be used to increase the debug level for internal AppDaemon operations as well as apps using the logging function. -D can be used to increase the debug level for internal AppDaemon operations as well as apps using the logging function.

View File

@ -11,7 +11,7 @@ regenerate: true
hide_github_edit: true hide_github_edit: true
--- ---
## Another Take on Automation ## {% linkable_title Another Take on Automation %}
If you haven't yet read Paulus' excellent Blog entry on [Perfect Home Automation](https://home-assistant.io/blog/2016/01/19/perfect-home-automation/) I would encourage you to take a look. As a veteran of several Home Automation systems with varying degrees success, it was this article more than anything else that convinced me that Home Assistant had the right philosophy behind it and was on the right track. One of the most important points made is that being able to control your lights from your phone, 9 times out of 10 is harder than using a lightswitch - where Home Automation really comes into its own is when you start removing the need to use a phone or the switch - the "Automation" in Home Automation. A surprisingly large number of systems out there miss this essential point and have limited abilities to automate anything which is why a robust and open system such as Home Assistant is such an important part of the equation in bring this all together in the vast and chaotic ecosystem that is the "Internet of Things". If you haven't yet read Paulus' excellent Blog entry on [Perfect Home Automation](https://home-assistant.io/blog/2016/01/19/perfect-home-automation/) I would encourage you to take a look. As a veteran of several Home Automation systems with varying degrees success, it was this article more than anything else that convinced me that Home Assistant had the right philosophy behind it and was on the right track. One of the most important points made is that being able to control your lights from your phone, 9 times out of 10 is harder than using a lightswitch - where Home Automation really comes into its own is when you start removing the need to use a phone or the switch - the "Automation" in Home Automation. A surprisingly large number of systems out there miss this essential point and have limited abilities to automate anything which is why a robust and open system such as Home Assistant is such an important part of the equation in bring this all together in the vast and chaotic ecosystem that is the "Internet of Things".
@ -38,11 +38,11 @@ So why `AppDaemon`? AppDaemon is not meant to replace Home Assistant Automations
It is in fact a testament to Home Assistant's open nature that a component like `AppDaemon` can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistant's underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for `AppDaemon` - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier. It is in fact a testament to Home Assistant's open nature that a component like `AppDaemon` can be integrated so neatly and closely that it acts in all ways like an extension of the system, not a second class citizen. Part of the strength of Home Assistant's underlying design is that it makes no assumptions whatever about what it is controlling or reacting to, or reporting state on. This is made achievable in part by the great flexibility of Python as a programming environment for Home Assistant, and carrying that forward has enabled me to use the same philosophy for `AppDaemon` - it took surprisingly little code to be able to respond to basic events and call services in a completely open ended manner - the bulk of the work after that was adding additonal functions to make things that were already possible easier.
## How it Works ## {% linkable_title How it Works %}
The best way to show what AppDaemon does is through a few simple examples. The best way to show what AppDaemon does is through a few simple examples.
### Sunrise/Sunset Lighting ### {% linkable_title Sunrise/Sunset Lighting %}
Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its `initialize()` function called which gives it a chance to register a callback for AppDaemons's scheduler for a specific time. In this case we are using `run_at_sunrise()` and `run_at_sunset()` to register 2 separate callbacks. The argument `0` is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Python's `datetime.timedelta` class for calculations. When sunrise or sunset occurs, the appropriate callback function, `sunrise_cb()` or `sunset_cb()` is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables `args["on_scene"]` and `args["off_scene"]` are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App. Lets start with a simple App to turn a light on every night at sunset and off every morning at sunrise. Every App when first started will have its `initialize()` function called which gives it a chance to register a callback for AppDaemons's scheduler for a specific time. In this case we are using `run_at_sunrise()` and `run_at_sunset()` to register 2 separate callbacks. The argument `0` is the number of seconds offset from sunrise or sunset and can be negative or positive. For complex intervals it can be convenient to use Python's `datetime.timedelta` class for calculations. When sunrise or sunset occurs, the appropriate callback function, `sunrise_cb()` or `sunset_cb()` is called which then makes a call to Home Assistant to turn the porch light on or off by activating a scene. The variables `args["on_scene"]` and `args["off_scene"]` are passed through from the configuration of this particular App, and the same code could be reused to activate completely different scenes in a different version of the App.
@ -127,4 +127,3 @@ If this has whet your appetite, feel free to give it a try.
Happy Automating! Happy Automating!

View File

@ -18,6 +18,6 @@ AppDaemon runs under windows and has been tested with the official 3.5.2 release
AppDaemon can be installed exactly as per the instructions for every other version using pip3. AppDaemon can be installed exactly as per the instructions for every other version using pip3.
## Windows Under the Linux Subsystem ## {% linkable_title Windows Under the Linux Subsystem %}
Windows 10 now supports a full Linux bash environment that is capable of running Python. This is essentially an Ubuntu distribution and works extremely well. It is possible to run AppDaemon in exactly the same way as for Linux distributions, and none of the above Windows Caveats apply to this version. This is the reccomended way to run AppDaemon in a Windows 10 and later environment. Windows 10 now supports a full Linux bash environment that is capable of running Python. This is essentially an Ubuntu distribution and works extremely well. It is possible to run AppDaemon in exactly the same way as for Linux distributions, and none of the above Windows Caveats apply to this version. This is the reccomended way to run AppDaemon in a Windows 10 and later environment.