Skip to content

Commit 905441d

Browse files
committed
add pydocstyle
1 parent 94b7c8b commit 905441d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.pre-commit-config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
1616
- id: debug-statements
17+
- repo: https://github.com/asottile/pyupgrade
18+
rev: v2.37.3
19+
hooks:
20+
- id: pyupgrade
21+
args: [--py37-plus]
1722
- repo: https://github.com/PyCQA/isort
1823
rev: 5.12.0
1924
hooks:

custom_components/ble_monitor/config_flow.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async def async_step_add_remove_device(self, user_input=None):
167167
and user_input[key].upper()
168168
!= self._sel_device.get(key).upper()
169169
):
170-
errors[key] = "cannot_change_{}".format(key)
170+
errors[key] = f"cannot_change_{key}"
171171
user_input[key] = self._sel_device.get(key)
172172
else:
173173
self._validate(user_input[key], key, errors)
@@ -248,7 +248,7 @@ async def async_step_add_remove_device(self, user_input=None):
248248
else:
249249
_LOGGER.error("Removing BLE monitor device %s from device registry", key)
250250
device_registry.async_remove_device(device.id)
251-
_LOGGER.error("Removing BLE monitor device %s from configuration {}".format(device), key)
251+
_LOGGER.error(f"Removing BLE monitor device %s from configuration {device}", key)
252252
del self._devices[key]
253253
return self._show_main_form(errors)
254254
device_option_schema = vol.Schema(

custom_components/ble_monitor/device_tracker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self, config, key):
165165
self._fkey = identifier_normalize(key)
166166
self._device_settings = self.get_device_settings()
167167
self._device_name = self._device_settings["name"]
168-
self._name = "ble tracker {}".format(self._device_name)
168+
self._name = f"ble tracker {self._device_name}"
169169
self._state = None
170170
self._extra_state_attributes = {}
171171
self._unique_id = "ble_tracker_" + self._device_name

0 commit comments

Comments
 (0)