1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00

Correct typing in control4 and activate mypy (#53156)

* Correct typing and activate mypy.

* Review comments.:wq
This commit is contained in:
jan iversen 2021-07-19 14:14:09 +02:00 committed by GitHub
parent 0802dd4293
commit 51d16202ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,6 @@
"""The Control4 integration."""
from __future__ import annotations
import json
import logging
@ -149,9 +151,9 @@ class Control4Entity(CoordinatorEntity):
coordinator: DataUpdateCoordinator,
name: str,
idx: int,
device_name: str,
device_manufacturer: str,
device_model: str,
device_name: str | None,
device_manufacturer: str | None,
device_model: str | None,
device_id: int,
) -> None:
"""Initialize a Control4 entity."""
@ -174,7 +176,7 @@ class Control4Entity(CoordinatorEntity):
@property
def unique_id(self) -> str:
"""Return a unique ID."""
return self._idx
return str(self._idx)
@property
def device_info(self):

View File

@ -1,4 +1,6 @@
"""Platform for Control4 Lights."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
@ -145,9 +147,9 @@ class Control4Light(Control4Entity, LightEntity):
coordinator: DataUpdateCoordinator,
name: str,
idx: int,
device_name: str,
device_manufacturer: str,
device_model: str,
device_name: str | None,
device_manufacturer: str | None,
device_model: str | None,
device_id: int,
is_dimmer: bool,
) -> None:

View File

@ -1116,9 +1116,6 @@ ignore_errors = true
[mypy-homeassistant.components.config.*]
ignore_errors = true
[mypy-homeassistant.components.control4.*]
ignore_errors = true
[mypy-homeassistant.components.conversation.*]
ignore_errors = true

View File

@ -34,7 +34,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.cloud.*",
"homeassistant.components.cloudflare.*",
"homeassistant.components.config.*",
"homeassistant.components.control4.*",
"homeassistant.components.conversation.*",
"homeassistant.components.deconz.*",
"homeassistant.components.demo.*",