I am trying to set up the REST API, however, the example from the docs throws an error:
TypeError: my_callback() missing 1 required positional argument: 'data'
This is the code:
import appdaemon.plugins.hass.hassapi as hass
class API(hass.Hass):
def initialize(self):
self.register_endpoint(my_callback, "test_endpoint")
def my_callback(self, data):
self.log(data)
response = {"message": "Hello World"}
return response, 200
I use the Hassio AppDaemon addon.