From a0067a298ac89b98e6baad536460abc22c6e3826 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 31 Jan 2020 06:45:23 -0500 Subject: [PATCH] Remove Throttle on async_setup and bump pyvizio version (#31337) --- homeassistant/components/vizio/const.py | 5 ----- homeassistant/components/vizio/manifest.json | 2 +- homeassistant/components/vizio/media_player.py | 4 ---- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/vizio/const.py b/homeassistant/components/vizio/const.py index 92fb37c153e..e3ac66e05c3 100644 --- a/homeassistant/components/vizio/const.py +++ b/homeassistant/components/vizio/const.py @@ -1,6 +1,4 @@ """Constants used by vizio component.""" -from datetime import timedelta - from pyvizio.const import ( DEVICE_CLASS_SPEAKER as VIZIO_DEVICE_CLASS_SPEAKER, DEVICE_CLASS_TV as VIZIO_DEVICE_CLASS_TV, @@ -72,6 +70,3 @@ VIZIO_SCHEMA = { vol.Coerce(int), vol.Range(min=1, max=10) ), } - -MIN_TIME_BETWEEN_FORCED_SCANS = timedelta(seconds=1) -MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10) diff --git a/homeassistant/components/vizio/manifest.json b/homeassistant/components/vizio/manifest.json index 2f3a581e113..7f397a4ed0c 100644 --- a/homeassistant/components/vizio/manifest.json +++ b/homeassistant/components/vizio/manifest.json @@ -2,7 +2,7 @@ "domain": "vizio", "name": "Vizio SmartCast TV", "documentation": "https://www.home-assistant.io/integrations/vizio", - "requirements": ["pyvizio==0.1.4"], + "requirements": ["pyvizio==0.1.16"], "dependencies": [], "codeowners": ["@raman325"], "config_flow": true, diff --git a/homeassistant/components/vizio/media_player.py b/homeassistant/components/vizio/media_player.py index 3ea70fe2acb..439a9a972d4 100644 --- a/homeassistant/components/vizio/media_player.py +++ b/homeassistant/components/vizio/media_player.py @@ -5,7 +5,6 @@ from typing import Callable, List from pyvizio import VizioAsync -from homeassistant import util from homeassistant.components.media_player import MediaPlayerDevice from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( @@ -32,8 +31,6 @@ from .const import ( DEVICE_ID, DOMAIN, ICON, - MIN_TIME_BETWEEN_FORCED_SCANS, - MIN_TIME_BETWEEN_SCANS, SUPPORTED_COMMANDS, VIZIO_DEVICE_CLASSES, ) @@ -111,7 +108,6 @@ class VizioDevice(MediaPlayerDevice): self._icon = ICON[device_class] self._available = True - @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) async def async_update(self) -> None: """Retrieve latest state of the device.""" is_on = await self._device.get_power_state(log_api_exception=False) diff --git a/requirements_all.txt b/requirements_all.txt index ca276bf8035..4c45014c12e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1696,7 +1696,7 @@ pyversasense==0.0.6 pyvesync==1.1.0 # homeassistant.components.vizio -pyvizio==0.1.4 +pyvizio==0.1.16 # homeassistant.components.velux pyvlx==0.2.12 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 5a8a794b429..abf8379932a 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -567,7 +567,7 @@ pyvera==0.3.7 pyvesync==1.1.0 # homeassistant.components.vizio -pyvizio==0.1.4 +pyvizio==0.1.16 # homeassistant.components.html5 pywebpush==1.9.2