Remove philips_js from mypy ignore list (#74659)
* Remove philips_js from mypy ignore list * Use class attribute
This commit is contained in:
parent
a6244eea28
commit
c6bff8ae18
7 changed files with 12 additions and 28 deletions
|
@ -108,6 +108,8 @@ class PluggableAction:
|
|||
class PhilipsTVDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Coordinator to update data."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(self, hass, api: PhilipsTV, options: Mapping) -> None:
|
||||
"""Set up the coordinator."""
|
||||
self.api = api
|
||||
|
@ -136,8 +138,7 @@ class PhilipsTVDataUpdateCoordinator(DataUpdateCoordinator[None]):
|
|||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the system descriptor."""
|
||||
entry: ConfigEntry = self.config_entry
|
||||
assert entry
|
||||
entry = self.config_entry
|
||||
if entry.unique_id:
|
||||
return entry.unique_id
|
||||
assert entry.entry_id
|
||||
|
|
|
@ -23,7 +23,7 @@ from .const import CONF_ALLOW_NOTIFY, CONF_SYSTEM, CONST_APP_ID, CONST_APP_NAME,
|
|||
|
||||
async def _validate_input(
|
||||
hass: core.HomeAssistant, host: str, api_version: int
|
||||
) -> tuple[dict, PhilipsTV]:
|
||||
) -> PhilipsTV:
|
||||
"""Validate the user input allows us to connect."""
|
||||
hub = PhilipsTV(host, api_version)
|
||||
|
||||
|
@ -44,7 +44,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
def __init__(self) -> None:
|
||||
"""Initialize flow."""
|
||||
super().__init__()
|
||||
self._current = {}
|
||||
self._current: dict[str, Any] = {}
|
||||
self._hub: PhilipsTV | None = None
|
||||
self._pair_state: Any = None
|
||||
|
||||
|
@ -62,7 +62,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
"""Attempt to pair with device."""
|
||||
assert self._hub
|
||||
|
||||
errors = {}
|
||||
errors: dict[str, str] = {}
|
||||
schema = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_PIN): str,
|
||||
|
|
|
@ -65,6 +65,10 @@ async def async_attach_trigger(
|
|||
}
|
||||
|
||||
device = registry.async_get(config[CONF_DEVICE_ID])
|
||||
if device is None:
|
||||
raise HomeAssistantError(
|
||||
f"Device id {config[CONF_DEVICE_ID]} not found in registry"
|
||||
)
|
||||
for config_entry_id in device.config_entries:
|
||||
coordinator: PhilipsTVDataUpdateCoordinator = hass.data[DOMAIN].get(
|
||||
config_entry_id
|
||||
|
|
|
@ -146,7 +146,7 @@ class PhilipsTVLightEntity(
|
|||
self._hs = None
|
||||
self._brightness = None
|
||||
self._cache_keys = None
|
||||
self._last_selected_effect: AmbilightEffect = None
|
||||
self._last_selected_effect: AmbilightEffect | None = None
|
||||
super().__init__(coordinator)
|
||||
|
||||
self._attr_supported_color_modes = {ColorMode.HS, ColorMode.ONOFF}
|
||||
|
|
|
@ -80,8 +80,7 @@ class PhilipsTVMediaPlayer(
|
|||
) -> None:
|
||||
"""Initialize the Philips TV."""
|
||||
self._tv = coordinator.api
|
||||
self._sources = {}
|
||||
self._channels = {}
|
||||
self._sources: dict[str, str] = {}
|
||||
self._supports = SUPPORT_PHILIPS_JS
|
||||
self._system = coordinator.system
|
||||
self._attr_name = coordinator.system["name"]
|
||||
|
|
15
mypy.ini
15
mypy.ini
|
@ -2746,21 +2746,6 @@ ignore_errors = true
|
|||
[mypy-homeassistant.components.onvif.sensor]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.philips_js]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.philips_js.config_flow]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.philips_js.device_trigger]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.philips_js.light]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.philips_js.media_player]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.plex.media_player]
|
||||
ignore_errors = true
|
||||
|
||||
|
|
|
@ -57,11 +57,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||
"homeassistant.components.onvif.camera",
|
||||
"homeassistant.components.onvif.device",
|
||||
"homeassistant.components.onvif.sensor",
|
||||
"homeassistant.components.philips_js",
|
||||
"homeassistant.components.philips_js.config_flow",
|
||||
"homeassistant.components.philips_js.device_trigger",
|
||||
"homeassistant.components.philips_js.light",
|
||||
"homeassistant.components.philips_js.media_player",
|
||||
"homeassistant.components.plex.media_player",
|
||||
"homeassistant.components.profiler",
|
||||
"homeassistant.components.solaredge.config_flow",
|
||||
|
|
Loading…
Add table
Reference in a new issue