Remove suppress_warning from config options for vizio component (#30536)

* move constants, move schema validation to init, prepare for zeroconf/config flow

* mistake in refactor

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* fix schema validation

* remove suppress warning config option

* remove config_flow from manifest since its not ready yet

* update requirements_all.txt

* fix issue with merge conflict
This commit is contained in:
Raman Gupta 2020-01-07 07:31:13 -05:00 committed by Paulus Schoutsen
parent 73af75cb41
commit a9f6dd698e
5 changed files with 3 additions and 19 deletions

View File

@ -10,7 +10,6 @@ from homeassistant.const import (
from homeassistant.helpers import config_validation as cv
from .const import (
CONF_SUPPRESS_WARNING,
CONF_VOLUME_STEP,
DEFAULT_DEVICE_CLASS,
DEFAULT_NAME,
@ -33,7 +32,6 @@ VIZIO_SCHEMA = {
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_ACCESS_TOKEN): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_SUPPRESS_WARNING, default=False): cv.boolean,
vol.Optional(CONF_DEVICE_CLASS, default=DEFAULT_DEVICE_CLASS): vol.All(
cv.string, vol.Lower, vol.In(["tv", "soundbar"])
),

View File

@ -1,6 +1,5 @@
"""Constants used by vizio component."""
CONF_SUPPRESS_WARNING = "suppress_warning"
CONF_VOLUME_STEP = "volume_step"
DEFAULT_NAME = "Vizio SmartCast"

View File

@ -3,7 +3,7 @@
"name": "Vizio",
"documentation": "https://www.home-assistant.io/integrations/vizio",
"requirements": [
"pyvizio==0.0.11"
"pyvizio==0.0.12"
],
"dependencies": [],
"codeowners": ["@raman325"]

View File

@ -3,7 +3,6 @@ from datetime import timedelta
import logging
from pyvizio import Vizio
from requests.packages import urllib3
import voluptuous as vol
from homeassistant import util
@ -28,13 +27,7 @@ from homeassistant.const import (
)
from . import VIZIO_SCHEMA, validate_auth
from .const import (
CONF_SUPPRESS_WARNING,
CONF_VOLUME_STEP,
DEFAULT_NAME,
DEVICE_ID,
ICON,
)
from .const import CONF_VOLUME_STEP, DEFAULT_NAME, DEVICE_ID, ICON
_LOGGER = logging.getLogger(__name__)
@ -78,12 +71,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
)
return
if config[CONF_SUPPRESS_WARNING]:
_LOGGER.warning(
"InsecureRequestWarning is disabled "
"because of Vizio platform configuration"
)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
add_entities([device], True)

View File

@ -1696,7 +1696,7 @@ pyversasense==0.0.6
pyvesync==1.1.0
# homeassistant.components.vizio
pyvizio==0.0.11
pyvizio==0.0.12
# homeassistant.components.velux
pyvlx==0.2.12