From 7cd587a1df5ab54e32827948a3691dffd51b7507 Mon Sep 17 00:00:00 2001 From: Andrew Cockburn Date: Tue, 19 Sep 2017 11:54:13 -0400 Subject: [PATCH] Update appdaemon.markdown --- source/_docs/ecosystem/appdaemon.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_docs/ecosystem/appdaemon.markdown b/source/_docs/ecosystem/appdaemon.markdown index a0aa90daf57..cfa7ddc50d6 100755 --- a/source/_docs/ecosystem/appdaemon.markdown +++ b/source/_docs/ecosystem/appdaemon.markdown @@ -35,7 +35,7 @@ The best way to show what AppDaemon does is through a few simple examples. Let's 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 two 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. ```python -import homeassistant.appapi as appapi +import appdaemon.appapi as appapi class OutsideLights(appapi.AppDaemon):