def send_key(self, key):
        """Send a key to the tv and handles exceptions."""
        try:
            self._remote.send_key(key)
            self._state = STATE_ON
        except (socket.timeout, TimeoutError, __HOLE__):
            self._state = STATE_OFF
            return False
        return True
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/media_player/panasonic_viera.py/PanasonicVieraTVDevice.send_key