Skip to content

Commit 0b99839

Browse files
authored
Optimize imports (#110)
1 parent 5c8fb6a commit 0b99839

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

custom_components/ta_cmi/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import asyncio
55
from datetime import timedelta
66
import time
7-
from types import MappingProxyType
87
from typing import Any
98

109
from async_timeout import timeout
@@ -113,7 +112,7 @@ async def custom_sleep(delay: int) -> None:
113112
start = time.time()
114113
try:
115114
await asyncio.sleep(delay)
116-
except CancelledError:
115+
except asyncio.CancelledError:
117116
elapsed = time.time() - start
118117
await asyncio.sleep(delay - elapsed)
119118

custom_components/ta_cmi/binary_sensor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""C.M.I binary sensor platform."""
22
from __future__ import annotations
33

4-
import copy
54
from typing import Any
65

76
from homeassistant.components.binary_sensor import (

custom_components/ta_cmi/device_parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Parser to parse device data."""
22
from __future__ import annotations
3+
34
from typing import Any
45

56
from homeassistant.const import CONF_API_VERSION, STATE_OFF, STATE_ON
6-
from ta_cmi import Channel, Device, ChannelType
7+
from ta_cmi import Channel, ChannelType, Device
78

89
from .const import (
910
CONF_CHANNELS,
@@ -12,10 +13,10 @@
1213
CONF_CHANNELS_NAME,
1314
CONF_CHANNELS_TYPE,
1415
CONF_DEVICE_FETCH_MODE,
15-
TYPE_BINARY,
16-
TYPE_SENSOR,
1716
DEVICE_TYPE,
1817
DEVICE_TYPE_STRING_MAP,
18+
TYPE_BINARY,
19+
TYPE_SENSOR,
1920
)
2021

2122

0 commit comments

Comments
 (0)