1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-08 22:32:21 +01:00

[ruff] Enable SIM rules and fix code simplification violations (#9872)

This commit is contained in:
J. Nick Koston
2025-07-24 20:26:08 -10:00
committed by GitHub
parent cb87f156d0
commit ffebd30033
72 changed files with 400 additions and 432 deletions

View File

@@ -1,3 +1,4 @@
import contextlib
from datetime import datetime
import hashlib
import json
@@ -52,10 +53,8 @@ def initialize(
client = prepare(
config, subscriptions, on_message, on_connect, username, password, client_id
)
try:
with contextlib.suppress(KeyboardInterrupt):
client.loop_forever()
except KeyboardInterrupt:
pass
return 0