@classmethod
def from_config(cls, xknx, config):
    """Initialize object from configuration structure."""
    hook = config.get('hook', 'on')
    target = config.get('target')
    method = config.get('method')
    counter = config.get('counter', 1)
    return cls(xknx, hook=hook, target=target, method=method, counter=counter)
