diff --git a/homeassistant/components/media_player/vizio.py b/homeassistant/components/media_player/vizio.py index 395f5bb369e..af3fdd1e15a 100644 --- a/homeassistant/components/media_player/vizio.py +++ b/homeassistant/components/media_player/vizio.py @@ -92,25 +92,31 @@ class VizioDevice(MediaPlayerDevice): def update(self): """Retrieve latest state of the TV.""" is_on = self._device.get_power_state() - if is_on is None: - self._state = None - return - if is_on is False: - self._state = STATE_OFF - else: + + if is_on: self._state = STATE_ON - volume = self._device.get_current_volume() - if volume is not None: - self._volume_level = float(volume) / 100. - 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) + volume = self._device.get_current_volume() + if volume is not None: + self._volume_level = float(volume) / 100. + + 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 = [input_.name for input_ in inputs] + + else: + if is_on is None: + self._state = None + else: + self._state = STATE_OFF + + self._volume_level = None + self._current_input = None + self._available_inputs = None @property def state(self):