Merge pull request #3809 from Rubyan/patch-2

Fixed the sunrise / sunset example code in the documentation
This commit is contained in:
Andrew Cockburn 2017-10-30 10:05:44 -04:00 committed by GitHub
commit a58d2a88a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,8 @@ import appdaemon.appapi as appapi
class OutsideLights(appapi.AppDaemon): class OutsideLights(appapi.AppDaemon):
def initialize(self): def initialize(self):
self.run_at_sunrise(self.sunrise_cb, 0) self.run_at_sunrise(self.sunrise_cb)
self.run_at_sunset(self.sunset_cb, 0) self.run_at_sunset(self.sunset_cb)
def sunrise_cb(self, kwargs): def sunrise_cb(self, kwargs):
self.turn_on(self.args["off_scene"]) self.turn_on(self.args["off_scene"])