def track_sunset(offset=None):
 def track_sunset_decorator(action):
  'Decorator to track sunset events.'
  event.track_sunset(HASS, functools.partial(action, HASS), offset)
  return action
 return track_sunset_decorator

def track_sunset ( offset = None ) : def track_sunset_decorator ( action ) : event . track_sunset ( HASS , functools . partial ( action , HASS ) , offset ) return action return track_sunset_decorator
decorator factory to track sunset events .