HI,
the below error message is obvious, but what am i supposed to do about it…?
Log Details (ERROR)
Fri Dec 08 2017 16:30:40 GMT+0100 (CET)
Error executing script: 'NoneType' object is not callable
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/components/python_script.py", line 166, in execute
exec(compiled.code, restricted_globals, local)
File "last_cmd.py", line 18, in <module>
TypeError: 'NoneType' object is not callable
referenced script is as follows:
# Get params
event = data.get('event')
# logger.error("LAST CMD: " + str(event))
# Sample: <Event call_service[L]: service_data=, service_call_id=78356624-86, service=mp_playpause, domain=script>
# Find the script name. TODO: Is it possible do with regex, dictionary, json...?
pos_start = event.find('service=')+8
pos_end = event.find(',', pos_start)
# Get the state object (script) from the name
entity_id = 'script.' + event[pos_start:pos_end]
state = hass.states.get(entity_id)
dt = datetime.datetime.now() #state.attributes.get('last_triggered')
time = "%02d:%02d" % (dt.hour, dt.minute)
# Ignore some names
msg = state.name
if (msg == 'None') or (msg.startswith('Set ')):
msg = ''
if (msg != '') :
# Sensor update
hass.states.set('sensor.last_command', '{} - {}'.format(time, msg), {
'custom_ui_state_card': 'state-card-value_only'
})
Is it an obvious syntax error, or could it be related to the recent updating of the custom ui files?
Please have a look,
Marius