From 083868ac01ca0c87b5480efca59f7b790bae6a66 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Wed, 4 Aug 2021 08:47:28 +0200 Subject: [PATCH] Enable mypy for Yamaha (#53920) --- homeassistant/components/yamaha/media_player.py | 5 +++-- mypy.ini | 3 --- script/hassfest/mypy_config.py | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/yamaha/media_player.py b/homeassistant/components/yamaha/media_player.py index 147a983b298..720f38a12ae 100644 --- a/homeassistant/components/yamaha/media_player.py +++ b/homeassistant/components/yamaha/media_player.py @@ -30,6 +30,7 @@ from homeassistant.const import ( STATE_PLAYING, ) from homeassistant.helpers import config_validation as cv, entity_platform +from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from .const import ( CURSOR_TYPE_DOWN, @@ -96,7 +97,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( class YamahaConfigInfo: """Configuration Info for Yamaha Receivers.""" - def __init__(self, config: None, discovery_info: None) -> None: + def __init__(self, config: ConfigType, discovery_info: DiscoveryInfoType) -> None: """Initialize the Configuration Info for Yamaha Receiver.""" self.name = config.get(CONF_NAME) self.host = config.get(CONF_HOST) @@ -109,7 +110,7 @@ class YamahaConfigInfo: if discovery_info is not None: self.name = discovery_info.get("name") self.model = discovery_info.get("model_name") - self.ctrl_url = discovery_info.get("control_url") + self.ctrl_url = str(discovery_info.get("control_url")) self.desc_url = discovery_info.get("description_url") self.zone_ignore = [] self.from_discovery = True diff --git a/mypy.ini b/mypy.ini index 9e87e1466bf..2f4b20747f9 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1756,9 +1756,6 @@ ignore_errors = true [mypy-homeassistant.components.xiaomi_miio.*] ignore_errors = true -[mypy-homeassistant.components.yamaha.*] -ignore_errors = true - [mypy-homeassistant.components.yeelight.*] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 09c1280c472..a0e80af2a2e 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -185,7 +185,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.xbox.*", "homeassistant.components.xiaomi_aqara.*", "homeassistant.components.xiaomi_miio.*", - "homeassistant.components.yamaha.*", "homeassistant.components.yeelight.*", "homeassistant.components.zha.*", "homeassistant.components.zwave.*",