[pre-commit.ci] pre-commit autoupdate (#748)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.282...v0.0.284)

* Ruff fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
This commit is contained in:
pre-commit-ci[bot] 2023-08-15 15:25:19 -07:00 committed by GitHub
commit 7a7baafcb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View file

@ -8,7 +8,7 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.282
rev: v0.0.284
hooks:
- id: ruff
args: ["--fix"]

View file

@ -51,12 +51,11 @@ def setup_service_call_interceptor(
# Convert data back to read-only
call.data = ReadOnlyDict(data)
except Exception as e: # noqa: BLE001
except Exception:
# Blindly catch all exceptions to avoid breaking light.turn_on
_LOGGER.error(
"Error for call '%s' in service_func_proxy: '%s'",
_LOGGER.exception(
"Error for call '%s' in service_func_proxy",
call.data,
e,
)
# Call original service handler with processed data
await existing_service.job.target(call)

View file

@ -681,7 +681,7 @@ def _convert_attributes(attributes: dict[str, Any]) -> dict[str, Any]:
if rgb is not None:
attributes[ATTR_RGB_COLOR] = rgb
_LOGGER.debug(f"Converted {attributes} to rgb {rgb}")
_LOGGER.debug("Converted attributes %s to rgb %s", attributes, rgb)
else:
_LOGGER.debug("No suitable color conversion found for %s", attributes)
@ -1041,11 +1041,10 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
try:
# HACK: this is a private method in `Entity` which can change
super()._call_on_remove_callbacks()
except AttributeError as err:
_LOGGER.error(
"%s: Caught AttributeError in `_call_on_remove_callbacks`: %s",
except AttributeError:
_LOGGER.exception(
"%s: Caught AttributeError in `_call_on_remove_callbacks`",
self._name,
err,
)
def _remove_interval_listener(self) -> None:
@ -1816,7 +1815,7 @@ class AdaptiveLightingManager:
single_switch_with_multiple_lights and switch_without_multi_light_intercept
):
_LOGGER.warning(
"Single switch with multiple lights targeted, but"
"Single switch with multiple lights targeted (%s), but"
" `multi_light_intercept: true` is not set, so skipping intercept"
" for all lights.",
switch_to_eids,