mirror of
https://github.com/home-assistant/core.git
synced 2025-04-19 14:57:52 +00:00
Correct typing in control4 and activate mypy (#53156)
* Correct typing and activate mypy. * Review comments.:wq
This commit is contained in:
parent
0802dd4293
commit
51d16202ab
@ -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):
|
||||
|
@ -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:
|
||||
|
3
mypy.ini
3
mypy.ini
@ -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
|
||||
|
||||
|
@ -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.*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user