Skip to content

Commit 208cc3d

Browse files
committed
style: configure isort
Configuration copied from homeassistant.
1 parent 83cf9e6 commit 208cc3d

File tree

2 files changed

+34
-26
lines changed

2 files changed

+34
-26
lines changed

custom_components/philips_airpurifier_coap/fan.py

+20-26
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
"""Philips Air Purifier & Humidifier"""
22
import asyncio
3-
import logging
43
from datetime import timedelta
5-
from typing import (
6-
Any,
7-
Callable,
8-
Dict,
9-
List,
10-
Optional,
11-
Union,
12-
)
4+
import logging
5+
from typing import Any, Callable, Dict, List, Optional, Union
136

14-
from homeassistant.components.fan import (
15-
FanEntity,
16-
PLATFORM_SCHEMA,
17-
SUPPORT_PRESET_MODE,
18-
)
7+
from aioairctrl import CoAPClient
8+
import voluptuous as vol
9+
10+
from homeassistant.components.fan import PLATFORM_SCHEMA, SUPPORT_PRESET_MODE, FanEntity
1911
from homeassistant.components.light import ATTR_BRIGHTNESS
2012
from homeassistant.const import (
2113
ATTR_ENTITY_ID,
@@ -32,8 +24,6 @@
3224
DiscoveryInfoType,
3325
HomeAssistantType,
3426
)
35-
import voluptuous as vol
36-
from aioairctrl import CoAPClient
3727

3828
from .const import (
3929
ATTR_AIR_QUALITY_INDEX,
@@ -124,23 +114,23 @@
124114
PHILIPS_TYPE,
125115
PHILIPS_WATER_LEVEL,
126116
PHILIPS_WIFI_VERSION,
127-
SERVICE_SET_CHILD_LOCK_OFF,
128-
SERVICE_SET_CHILD_LOCK_ON,
129-
SERVICE_SET_DISPLAY_BACKLIGHT_OFF,
130-
SERVICE_SET_DISPLAY_BACKLIGHT_ON,
131-
SERVICE_SET_FUNCTION,
132-
SERVICE_SET_HUMIDITY_TARGET,
133-
SERVICE_SET_LIGHT_BRIGHTNESS,
134-
PRESET_MODE_SPEED_1,
135-
PRESET_MODE_SPEED_2,
136-
PRESET_MODE_SPEED_3,
137117
PRESET_MODE_ALLERGEN,
138118
PRESET_MODE_AUTO,
139119
PRESET_MODE_BACTERIA,
140120
PRESET_MODE_GENTLE,
141121
PRESET_MODE_NIGHT,
142122
PRESET_MODE_SLEEP,
123+
PRESET_MODE_SPEED_1,
124+
PRESET_MODE_SPEED_2,
125+
PRESET_MODE_SPEED_3,
143126
PRESET_MODE_TURBO,
127+
SERVICE_SET_CHILD_LOCK_OFF,
128+
SERVICE_SET_CHILD_LOCK_ON,
129+
SERVICE_SET_DISPLAY_BACKLIGHT_OFF,
130+
SERVICE_SET_DISPLAY_BACKLIGHT_ON,
131+
SERVICE_SET_FUNCTION,
132+
SERVICE_SET_HUMIDITY_TARGET,
133+
SERVICE_SET_LIGHT_BRIGHTNESS,
144134
)
145135

146136
_LOGGER = logging.getLogger(__name__)
@@ -625,6 +615,7 @@ class PhilipsAC2889(PhilipsGenericCoAPFan):
625615
PRESET_MODE_TURBO: {PHILIPS_POWER: "1", PHILIPS_MODE: "M", PHILIPS_SPEED: "t"},
626616
}
627617

618+
628619
class PhilipsAC2939(PhilipsTVOCMixin, PhilipsGenericCoAPFan):
629620
AVAILABLE_PRESET_MODES = {
630621
PRESET_MODE_AUTO: {PHILIPS_POWER: "1", PHILIPS_MODE: "AG"},
@@ -633,6 +624,7 @@ class PhilipsAC2939(PhilipsTVOCMixin, PhilipsGenericCoAPFan):
633624
PRESET_MODE_TURBO: {PHILIPS_POWER: "1", PHILIPS_MODE: "T"},
634625
}
635626

627+
636628
class PhilipsAC2958(PhilipsGenericCoAPFan):
637629
AVAILABLE_PRESET_MODES = {
638630
PRESET_MODE_AUTO: {PHILIPS_POWER: "1", PHILIPS_MODE: "AG"},
@@ -641,6 +633,7 @@ class PhilipsAC2958(PhilipsGenericCoAPFan):
641633
PRESET_MODE_TURBO: {PHILIPS_POWER: "1", PHILIPS_MODE: "T"},
642634
}
643635

636+
644637
class PhilipsAC3033(PhilipsTVOCMixin, PhilipsGenericCoAPFan):
645638
AVAILABLE_PRESET_MODES = {
646639
PRESET_MODE_SPEED_1: {PHILIPS_POWER: "1", PHILIPS_MODE: "M", PHILIPS_SPEED: "1"},
@@ -650,6 +643,7 @@ class PhilipsAC3033(PhilipsTVOCMixin, PhilipsGenericCoAPFan):
650643
PRESET_MODE_TURBO: {PHILIPS_POWER: "1", PHILIPS_MODE: "T", PHILIPS_SPEED: "t"},
651644
}
652645

646+
653647
class PhilipsAC3059(PhilipsTVOCMixin, PhilipsGenericCoAPFan):
654648
AVAILABLE_PRESET_MODES = {
655649
PRESET_MODE_SPEED_1: {PHILIPS_POWER: "1", PHILIPS_MODE: "M", PHILIPS_SPEED: "1"},

pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
[tool.black]
22
line-length = 100
33
target-version = ['py36', 'py37', 'py38']
4+
5+
[tool.isort]
6+
# https://github.com/PyCQA/isort/wiki/isort-Settings
7+
profile = "black"
8+
# will group `import x` and `from x import` of the same module.
9+
force_sort_within_sections = true
10+
known_first_party = [
11+
"homeassistant",
12+
"tests",
13+
]
14+
forced_separate = [
15+
"tests",
16+
]
17+
combine_as_imports = true

0 commit comments

Comments
 (0)