Callback functions
In NetDaemon it is possible to get callbacks from service calls. This feature requires the companion custom component installed in Home Assistant. You can find the companion app in the net-daemon/integration repo.
If you use the [HomeAssistantServiceCall]
attribute on a callback function, se example below, NetDaemon automatically registers a service call that you can use from Home Assistant to call code in your apps. The name of the call will be netdaemon.name_of_function
. It will convert all upper case to _
to use snake casing. So function called CallMeFromHass
will be named netdaemon.call_me_from_hass
#
Callback function methodCallback function works both as syncronous and asyncronious function calls.
#
Data sent in service callYou can send any data and it will be received as dynamic variable in callback function. List will be list of objects, objects will be properties.
Example of service calls and how to parse them:
Data from Home Assistant
Data from Home Assistant