Have a pretty simple automation:
import appdaemon.appapi as appapi
import datetime
class AutomateLights(appapi.AppDaemon):
def initialize(self):
self.run_at_sunset(self.lights_on, datetime.timedelta(minutes = -30).total_seconds(), "Sunset -30 mins")
def lights_on(self, entity, attribute, old, new, kwargs):
self.log("Turning on Lights: Sunset Triggered")
for lights in self.split_device_list(self.args["lights"]):
self.turn_on(lights)
When I save this I get this in the error.log?
2017-02-15 08:24:43.052500 WARNING ------------------------------------------------------------
2017-02-15 08:24:43.054204 WARNING Unexpected error:
2017-02-15 08:24:43.056351 WARNING ------------------------------------------------------------
2017-02-15 08:24:43.059134 WARNING Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 938, in check_config
new_config[name]["module"], new_config[name]
File "/usr/local/lib/python3.5/site-packages/appdaemon/appdaemon.py", line 690, in init_object
conf.objects[name]["object"].initialize()
File "/home/pi/appdaemon/conf/apps/automate_lights.py", line 19, in initialize
self.run_at_sunset(self.lights_on, datetime.timedelta(minutes = -30).total_seconds(), "Sunset -30 mins")
TypeError: run_at_sunset() takes 2 positional arguments but 4 were given
2017-02-15 08:24:43.061160 WARNING ------------------------------------------------------------