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:
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user