def track_state_change(entity_ids, from_state=None, to_state=None):
 def track_state_change_decorator(action):
  'Decorator to track state changes.'
  event.track_state_change(HASS, entity_ids, functools.partial(action, HASS), from_state, to_state)
  return action
 return track_state_change_decorator

def track_state_change ( entity_ids , from_state = None , to_state = None ) : def track_state_change_decorator ( action ) : event . track_state_change ( HASS , entity_ids , functools . partial ( action , HASS ) , from_state , to_state ) return action return track_state_change_decorator
decorator factory to track state changes for entity id .