mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +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."""
|
"""The Control4 integration."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -149,9 +151,9 @@ class Control4Entity(CoordinatorEntity):
|
|||||||
coordinator: DataUpdateCoordinator,
|
coordinator: DataUpdateCoordinator,
|
||||||
name: str,
|
name: str,
|
||||||
idx: int,
|
idx: int,
|
||||||
device_name: str,
|
device_name: str | None,
|
||||||
device_manufacturer: str,
|
device_manufacturer: str | None,
|
||||||
device_model: str,
|
device_model: str | None,
|
||||||
device_id: int,
|
device_id: int,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize a Control4 entity."""
|
"""Initialize a Control4 entity."""
|
||||||
@ -174,7 +176,7 @@ class Control4Entity(CoordinatorEntity):
|
|||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
return self._idx
|
return str(self._idx)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self):
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
"""Platform for Control4 Lights."""
|
"""Platform for Control4 Lights."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
@ -145,9 +147,9 @@ class Control4Light(Control4Entity, LightEntity):
|
|||||||
coordinator: DataUpdateCoordinator,
|
coordinator: DataUpdateCoordinator,
|
||||||
name: str,
|
name: str,
|
||||||
idx: int,
|
idx: int,
|
||||||
device_name: str,
|
device_name: str | None,
|
||||||
device_manufacturer: str,
|
device_manufacturer: str | None,
|
||||||
device_model: str,
|
device_model: str | None,
|
||||||
device_id: int,
|
device_id: int,
|
||||||
is_dimmer: bool,
|
is_dimmer: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -1116,9 +1116,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.config.*]
|
[mypy-homeassistant.components.config.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.control4.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.conversation.*]
|
[mypy-homeassistant.components.conversation.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.cloud.*",
|
"homeassistant.components.cloud.*",
|
||||||
"homeassistant.components.cloudflare.*",
|
"homeassistant.components.cloudflare.*",
|
||||||
"homeassistant.components.config.*",
|
"homeassistant.components.config.*",
|
||||||
"homeassistant.components.control4.*",
|
|
||||||
"homeassistant.components.conversation.*",
|
"homeassistant.components.conversation.*",
|
||||||
"homeassistant.components.deconz.*",
|
"homeassistant.components.deconz.*",
|
||||||
"homeassistant.components.demo.*",
|
"homeassistant.components.demo.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user