def toggle(self, **kwargs: Any) -> None:
    'Toggle the entity.'
    if self.is_on:
        self.turn_off(**kwargs)
    else:
        self.turn_on(**kwargs)
Toggle the entity.
def toggle(self, **kwargs: Any) -> None:
    
    if self.is_on:
        self.turn_off(**kwargs)
    else:
        self.turn_on(**kwargs)