'Retrieve latest state of the TV.'

@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
def update(self):

    is_on = self._device.get_power_state()
    if (is_on is None):
        self._state = STATE_UNKNOWN
        return
    elif (is_on is False):
        self._state = STATE_OFF
    else:
        self._state = STATE_ON
    self._volume_level = self._device.get_current_volume()
    input_ = self._device.get_current_input()
    if (input_ is not None):
        self._current_input = input_.meta_name
    inputs = self._device.get_inputs()
    if (inputs is not None):
        self._available_inputs = []
        for input_ in inputs:
            self._available_inputs.append(input_.name)
