def hassfunction(func):
    'Wrap function that depend on hass.'

    @wraps(func)
    def wrapper(*args, **kwargs):
        return func(hass, *args[1:], **kwargs)
    return contextfunction(wrapper)
Wrap function that depend on hass.
def hassfunction(func):
    

    @wraps(func)
    def wrapper(*args, **kwargs):
        return func(hass, *args[1:], **kwargs)
    return contextfunction(wrapper)