I am trying to get the event data inside a python_script.
I call media_player.kodi_call_method
with:
{
"entity_id":"media_player.kodi",
"method":"VideoLibrary.GetTVShows",
"properties": ["playcount", "season", "episode"]
}
I then react with this automation:
- alias: Kodi event
trigger:
platform: event
event_type: kodi_call_method_result
action:
service: python_script.kodi
data_template:
event: '{{ trigger.event }}'
How do I parse the event object in the python script?
event = data.get('event', 'testing')
logger.info(event.result)
This returns None
… and event['result']
doesn’t work either…
event
contains the correct data and I see it in the logfile:
2017-11-20 23:03:16 INFO (Thread-10) [homeassistant.components.python_script.kodi.py] <Event kodi_call_method_result[L]: result_ok=True, entity_id=media_player.kodi, result=limits=start=0, total=28, end=28, tvshows=[{'label': ....