Skip to content

Commit 05f18b3

Browse files
committed
black
1 parent 91e3542 commit 05f18b3

File tree

16 files changed

+35
-13
lines changed

16 files changed

+35
-13
lines changed

custom_components/lock_code_manager/__init__.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Lock Code Manager Integration."""
2+
23
from __future__ import annotations
34

45
import asyncio
@@ -243,10 +244,14 @@ async def async_update_listener(hass: HomeAssistant, config_entry: ConfigEntry)
243244
)
244245
async_dispatcher_send(hass, f"{DOMAIN}_{entry_id}_add_locks", locks_to_add)
245246
for lock_entity_id in locks_to_add:
246-
lock = hass.data[DOMAIN][entry_id][CONF_LOCKS][
247-
lock_entity_id
248-
] = async_create_lock_instance(
249-
hass, dr.async_get(hass), er.async_get(hass), config_entry, lock_entity_id
247+
lock = hass.data[DOMAIN][entry_id][CONF_LOCKS][lock_entity_id] = (
248+
async_create_lock_instance(
249+
hass,
250+
dr.async_get(hass),
251+
er.async_get(hass),
252+
config_entry,
253+
lock_entity_id,
254+
)
250255
)
251256
await lock.async_setup()
252257

@@ -270,9 +275,9 @@ async def async_update_listener(hass: HomeAssistant, config_entry: ConfigEntry)
270275
_LOGGER.debug(
271276
"%s (%s): Creating coordinator for lock %s", entry_id, entry_title, lock
272277
)
273-
coordinator = hass.data[DOMAIN][entry_id][COORDINATORS][
274-
lock_entity_id
275-
] = LockUsercodeUpdateCoordinator(hass, lock)
278+
coordinator = hass.data[DOMAIN][entry_id][COORDINATORS][lock_entity_id] = (
279+
LockUsercodeUpdateCoordinator(hass, lock)
280+
)
276281
await coordinator.async_config_entry_first_refresh()
277282
for slot_num in new_slots:
278283
_LOGGER.debug(

custom_components/lock_code_manager/binary_sensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Sensor for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import asyncio

custom_components/lock_code_manager/config_flow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Adds config flow for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import logging
@@ -163,9 +164,9 @@ async def async_step_code_slot(
163164
if user_input.get(CONF_ENABLED) and not user_input.get(CONF_PIN):
164165
errors[CONF_PIN] = "missing_pin_if_enabled"
165166
else:
166-
self.data[CONF_SLOTS][
167-
int(self.slots_to_configure.pop(0))
168-
] = CODE_SLOT_SCHEMA(user_input)
167+
self.data[CONF_SLOTS][int(self.slots_to_configure.pop(0))] = (
168+
CODE_SLOT_SCHEMA(user_input)
169+
)
169170
if not self.slots_to_configure:
170171
return self.async_create_entry(title=self.title, data=self.data)
171172

custom_components/lock_code_manager/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Constants for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
from homeassistant.const import CONF_ENABLED, CONF_NAME, CONF_PIN, Platform

custom_components/lock_code_manager/coordinator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Lock Code Manager Coordinators."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/lock_code_manager/entity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Base entity class for Lock Code Manager."""
2+
23
from __future__ import annotations
34

45
import copy

custom_components/lock_code_manager/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Exceptions for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
from homeassistant.exceptions import HomeAssistantError

custom_components/lock_code_manager/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helpers for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import copy

custom_components/lock_code_manager/number.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Number for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/lock_code_manager/providers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
There should be one file per integration, named after the integration.
55
"""
6+
67
from ._base import BaseLock
78
from .zwave_js import ZWaveJSLock
89

custom_components/lock_code_manager/providers/_base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Base integration module."""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass, field
@@ -246,9 +247,11 @@ def fire_code_slot_event(
246247
event_data={
247248
ATTR_NOTIFICATION_SOURCE: notification_source,
248249
ATTR_ENTITY_ID: lock_entity_id,
249-
ATTR_STATE: state.state
250-
if (state := self.hass.states.get(lock_entity_id))
251-
else "",
250+
ATTR_STATE: (
251+
state.state
252+
if (state := self.hass.states.get(lock_entity_id))
253+
else ""
254+
),
252255
ATTR_ACTION_TEXT: action_text,
253256
ATTR_CODE_SLOT: code_slot or 0,
254257
ATTR_CODE_SLOT_NAME: name_state.state if name_state else "",

custom_components/lock_code_manager/providers/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Constants for integrations module."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/lock_code_manager/providers/zwave_js.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for Z-Wave JS locks."""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass, field

custom_components/lock_code_manager/sensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Sensor for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/lock_code_manager/switch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Switch for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import logging

custom_components/lock_code_manager/text.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Text for lock_code_manager."""
2+
23
from __future__ import annotations
34

45
import logging

0 commit comments

Comments
 (0)