diff --git a/homeassistant/components/vizio/manifest.json b/homeassistant/components/vizio/manifest.json index 682405a375b..f12d5d0c358 100644 --- a/homeassistant/components/vizio/manifest.json +++ b/homeassistant/components/vizio/manifest.json @@ -3,7 +3,7 @@ "name": "Vizio", "documentation": "https://www.home-assistant.io/integrations/vizio", "requirements": [ - "pyvizio==0.0.7" + "pyvizio==0.0.9" ], "dependencies": [], "codeowners": ["@raman325"] diff --git a/homeassistant/components/vizio/media_player.py b/homeassistant/components/vizio/media_player.py index 94601216f23..ac920a05330 100644 --- a/homeassistant/components/vizio/media_player.py +++ b/homeassistant/components/vizio/media_player.py @@ -64,9 +64,7 @@ def validate_auth(config): token = config.get(CONF_ACCESS_TOKEN) if config[CONF_DEVICE_CLASS] == "tv" and (token is None or token == ""): raise vol.Invalid( - "When '{}' is 'tv' then '{}' is required.".format( - CONF_DEVICE_CLASS, CONF_ACCESS_TOKEN - ), + f"When '{CONF_DEVICE_CLASS}' is 'tv' then '{CONF_ACCESS_TOKEN}' is required.", path=[CONF_ACCESS_TOKEN], ) return config @@ -135,6 +133,7 @@ class VizioDevice(MediaPlayerDevice): self._supported_commands = SUPPORTED_COMMANDS[device_type] self._device = Vizio(DEVICE_ID, host, DEFAULT_NAME, token, device_type) self._max_volume = float(self._device.get_max_volume()) + self._unique_id = self._device.get_esn() @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) def update(self): @@ -196,6 +195,11 @@ class VizioDevice(MediaPlayerDevice): """Flag device features that are supported.""" return self._supported_commands + @property + def unique_id(self): + """Return the unique id of the device.""" + return self._unique_id + def turn_on(self): """Turn the device on.""" self._device.pow_on() diff --git a/requirements_all.txt b/requirements_all.txt index 80d93c4d4f2..afacd33482c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1693,7 +1693,7 @@ pyversasense==0.0.6 pyvesync==1.1.0 # homeassistant.components.vizio -pyvizio==0.0.7 +pyvizio==0.0.9 # homeassistant.components.velux pyvlx==0.2.12