Skip to content

Commit cb9a35e

Browse files
committed
Small ruff-fixes
1 parent 52c691d commit cb9a35e

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

custom_components/plugwise_usb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from plugwise_usb.api import NodeEvent
1212
from plugwise_usb.exceptions import StickError
1313

14-
from .const import (
14+
from .const import CONF_USB_PATH, NODES, PLUGWISE_USB_PLATFORMS, STICK
1515
CONF_USB_PATH,
1616
NODES,
1717
PLUGWISE_USB_PLATFORMS,

custom_components/plugwise_usb/binary_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1717
from plugwise_usb.api import NodeEvent, NodeFeature
1818

19-
from .const import DOMAIN, NODES, STICK, UNSUB_NODE_LOADED
19+
from .const import NODES, STICK, UNSUB_NODE_LOADED
2020
from .entity import PlugwiseUSBEntity, PlugwiseUSBEntityDescription
2121

2222
_LOGGER = logging.getLogger(__name__)

custom_components/plugwise_usb/coordinator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""DataUpdateCoordinator for Plugwise USB-Stick."""
22

3-
import asyncio
43
from collections import Counter
54
from datetime import timedelta
65
import logging
@@ -53,7 +52,7 @@ def __init__(
5352
async def async_node_update(self) -> dict[NodeFeature, Any]:
5453
"""Request status update for Plugwise Node."""
5554
states: dict[NodeFeature, Any] = {}
56-
55+
5756
# Only unique features
5857
freq_features = Counter(self.async_contexts())
5958
features = tuple(freq_features.keys())
@@ -63,7 +62,7 @@ async def async_node_update(self) -> dict[NodeFeature, Any]:
6362
except StickError as err:
6463
raise ConfigEntryError from err
6564
except (StickTimeout, NodeTimeout) as err:
66-
raise asyncio.TimeoutError from err
65+
raise TimeoutError from err
6766
except NodeError as err:
6867
raise UpdateFailed from err
6968

custom_components/plugwise_usb/entity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
CoordinatorEntity,
1313
)
1414
from plugwise_usb.api import PUSHING_FEATURES, NodeFeature, NodeInfo
15+
from homeassistant.helpers.update_coordinator import CoordinatorEntity
1516

1617
from .const import DOMAIN
1718
from .coordinator import PlugwiseUSBDataUpdateCoordinator

custom_components/plugwise_usb/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from homeassistant.helpers.entity_platform import AddEntitiesCallback
2727
from plugwise_usb.api import NodeEvent, NodeFeature
2828

29-
from .const import DOMAIN, NODES, STICK, UNSUB_NODE_LOADED
29+
from .const import NODES, STICK, UNSUB_NODE_LOADED
3030
from .entity import PlugwiseUSBEntity, PlugwiseUSBEntityDescription
3131

3232
_LOGGER = logging.getLogger(__name__)

custom_components/plugwise_usb/switch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from homeassistant.helpers.entity_platform import AddEntitiesCallback
1717
from plugwise_usb.api import NodeEvent, NodeFeature
1818

19-
from .const import DOMAIN, NODES, STICK, UNSUB_NODE_LOADED
19+
from .const import NODES, STICK, UNSUB_NODE_LOADED
2020
from .coordinator import PlugwiseUSBDataUpdateCoordinator
2121
from .entity import PlugwiseUSBEntity, PlugwiseUSBEntityDescription
2222

tests/components/plugwise_usb/test_config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def test_user_flow_select(hass):
4848
usb_mock.return_value.initialize = AsyncMock(return_value=None)
4949
usb_mock.return_value.disconnect = AsyncMock(return_value=None)
5050
usb_mock.return_value.mac_stick = MagicMock(return_value="01:23:45:67:AB")
51-
51+
5252
result = await hass.config_entries.flow.async_configure(
5353
result["flow_id"], user_input={CONF_USB_PATH: port_select}
5454
)

0 commit comments

Comments
 (0)