def set_tellstick_state(self, last_command_sent, last_data_sent):
        """Update the internal representation of the switch."""
        from tellcore.constants import TELLSTICK_TURNON, TELLSTICK_DIM
        if last_command_sent == TELLSTICK_DIM:
            if last_data_sent is not None:
                self._brightness = int(last_data_sent)
            self._state = self._brightness > 0
        else:
            self._state = last_command_sent == TELLSTICK_TURNON
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/light/tellstick.py/TellstickLight.set_tellstick_state/original