Skip to content

Commit e3184f9

Browse files
committed
Reformat
1 parent 51250bf commit e3184f9

File tree

4 files changed

+34
-31
lines changed

4 files changed

+34
-31
lines changed

custom_components/hon/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def wrapper(*args: Any, **kwargs: Any) -> None:
3737

3838
return wrapper
3939

40+
4041
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
4142
session = aiohttp_client.async_get_clientsession(hass)
4243
if (config_dir := hass.config.config_dir) is None:
@@ -59,7 +60,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
5960
hass, _LOGGER, name=DOMAIN
6061
)
6162

62-
hon.subscribe_updates(make_threadsafe_callback(hass, coordinator.async_set_updated_data))
63+
hon.subscribe_updates(
64+
make_threadsafe_callback(hass, coordinator.async_set_updated_data)
65+
)
6366

6467
hass.data.setdefault(DOMAIN, {})
6568
hass.data[DOMAIN][entry.unique_id] = {"hon": hon, "coordinator": coordinator}
@@ -78,4 +81,4 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
7881
if unload:
7982
if not hass.data[DOMAIN]:
8083
hass.data.pop(DOMAIN, None)
81-
return unload
84+
return unload

custom_components/hon/binary_sensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class HonBinarySensorEntityDescription(BinarySensorEntityDescription):
316316

317317

318318
async def async_setup_entry(
319-
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
319+
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
320320
) -> None:
321321
entities = []
322322
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
@@ -341,8 +341,8 @@ def is_on(self) -> bool:
341341
@callback
342342
def _handle_coordinator_update(self, update: bool = True) -> None:
343343
self._attr_native_value = (
344-
self._device.get(self.entity_description.key, "")
345-
== self.entity_description.on_value
344+
self._device.get(self.entity_description.key, "")
345+
== self.entity_description.on_value
346346
)
347347
if update:
348348
self.async_write_ha_state()

custom_components/hon/button.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
async def async_setup_entry(
59-
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
59+
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
6060
) -> None:
6161
entities: list[HonButtonType] = []
6262
for device in hass.data[DOMAIN][entry.unique_id]["hon"].appliances:
@@ -80,15 +80,15 @@ async def async_press(self) -> None:
8080
def available(self) -> bool:
8181
"""Return True if entity is available."""
8282
return (
83-
super().available
84-
and int(self._device.get("remoteCtrValid", "1")) == 1
85-
and self._device.connection
83+
super().available
84+
and int(self._device.get("remoteCtrValid", "1")) == 1
85+
and self._device.connection
8686
)
8787

8888

8989
class HonDeviceInfo(HonEntity, ButtonEntity):
9090
def __init__(
91-
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
91+
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
9292
) -> None:
9393
super().__init__(hass, entry, device)
9494

@@ -103,12 +103,12 @@ async def async_press(self) -> None:
103103
persistent_notification.create(
104104
self._hass, f"````\n```\n{self._device.diagnose}\n```\n````", title
105105
)
106-
_LOGGER.info(self._device.diagnose.replace(" ", "\u200B "))
106+
_LOGGER.info(self._device.diagnose.replace(" ", "\u200b "))
107107

108108

109109
class HonDataArchive(HonEntity, ButtonEntity):
110110
def __init__(
111-
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
111+
self, hass: HomeAssistant, entry: ConfigEntry, device: HonAppliance
112112
) -> None:
113113
super().__init__(hass, entry, device)
114114

custom_components/hon/climate.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class HonClimateEntityDescription(ClimateEntityDescription):
103103

104104

105105
async def async_setup_entry(
106-
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
106+
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
107107
) -> None:
108108
entities = []
109109
entity: HonClimateEntity | HonACClimateEntity
@@ -128,11 +128,11 @@ class HonACClimateEntity(HonEntity, ClimateEntity):
128128
_enable_turn_on_off_backwards_compatibility = False
129129

130130
def __init__(
131-
self,
132-
hass: HomeAssistant,
133-
entry: ConfigEntry,
134-
device: HonAppliance,
135-
description: HonACClimateEntityDescription,
131+
self,
132+
hass: HomeAssistant,
133+
entry: ConfigEntry,
134+
device: HonAppliance,
135+
description: HonACClimateEntityDescription,
136136
) -> None:
137137
super().__init__(hass, entry, device, description)
138138

@@ -152,12 +152,12 @@ def __init__(
152152
SWING_BOTH,
153153
]
154154
self._attr_supported_features = (
155-
ClimateEntityFeature.TURN_ON
156-
| ClimateEntityFeature.TURN_OFF
157-
| ClimateEntityFeature.TARGET_TEMPERATURE
158-
| ClimateEntityFeature.FAN_MODE
159-
| ClimateEntityFeature.SWING_MODE
160-
| ClimateEntityFeature.PRESET_MODE
155+
ClimateEntityFeature.TURN_ON
156+
| ClimateEntityFeature.TURN_OFF
157+
| ClimateEntityFeature.TARGET_TEMPERATURE
158+
| ClimateEntityFeature.FAN_MODE
159+
| ClimateEntityFeature.SWING_MODE
160+
| ClimateEntityFeature.PRESET_MODE
161161
)
162162

163163
self._handle_coordinator_update(update=False)
@@ -297,16 +297,16 @@ class HonClimateEntity(HonEntity, ClimateEntity):
297297
_enable_turn_on_off_backwards_compatibility = False
298298

299299
def __init__(
300-
self,
301-
hass: HomeAssistant,
302-
entry: ConfigEntry,
303-
device: HonAppliance,
304-
description: HonClimateEntityDescription,
300+
self,
301+
hass: HomeAssistant,
302+
entry: ConfigEntry,
303+
device: HonAppliance,
304+
description: HonClimateEntityDescription,
305305
) -> None:
306306
super().__init__(hass, entry, device, description)
307307

308308
self._attr_supported_features = (
309-
ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TARGET_TEMPERATURE
309+
ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TARGET_TEMPERATURE
310310
)
311311

312312
self._attr_temperature_unit = UnitOfTemperature.CELSIUS
@@ -324,7 +324,7 @@ def __init__(
324324
if mode not in data.parameters["program"].values:
325325
continue
326326
if (zone := data.parameters.get("zone")) and isinstance(
327-
self.entity_description.name, str
327+
self.entity_description.name, str
328328
):
329329
if self.entity_description.name.lower() in zone.values:
330330
modes.append(mode)

0 commit comments

Comments
 (0)