Enable ruff RUF005 and fix occurrences (#113589)

This commit is contained in:
Sid 2024-03-16 18:37:20 +01:00 committed by GitHub
parent 2a5c85a020
commit ccd2e989c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 150 additions and 128 deletions

View file

@ -570,9 +570,10 @@ class OptionsFlowHandler(OptionsFlow):
if user_input is not None:
zone = {"zone": self.active_cfg}
zone.update(user_input)
self.new_opt[CONF_BINARY_SENSORS] = self.new_opt.get(
CONF_BINARY_SENSORS, []
) + [zone]
self.new_opt[CONF_BINARY_SENSORS] = [
*self.new_opt.get(CONF_BINARY_SENSORS, []),
zone,
]
self.io_cfg.pop(self.active_cfg)
self.active_cfg = None
@ -645,7 +646,7 @@ class OptionsFlowHandler(OptionsFlow):
if user_input is not None:
zone = {"zone": self.active_cfg}
zone.update(user_input)
self.new_opt[CONF_SENSORS] = self.new_opt.get(CONF_SENSORS, []) + [zone]
self.new_opt[CONF_SENSORS] = [*self.new_opt.get(CONF_SENSORS, []), zone]
self.io_cfg.pop(self.active_cfg)
self.active_cfg = None
@ -714,7 +715,7 @@ class OptionsFlowHandler(OptionsFlow):
zone = {"zone": self.active_cfg}
zone.update(user_input)
del zone[CONF_MORE_STATES]
self.new_opt[CONF_SWITCHES] = self.new_opt.get(CONF_SWITCHES, []) + [zone]
self.new_opt[CONF_SWITCHES] = [*self.new_opt.get(CONF_SWITCHES, []), zone]
# iterate through multiple switch states
if self.current_states: