Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Old method
- def turn_off(self, **kwargs):
- """Turn off the light."""
- self._device.switch_off()
- # New method
- def turn_off(self, **kwargs):
- """Turn off the light."""
- if self._device.switch_off(): # If response is valid
- self.schedule_update_ha_state() # Immediately update device state in HA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement