From 989ab5029a3785a94216146ba9c3f869bff88954 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 28 Oct 2020 11:59:07 +0100 Subject: [PATCH] Use dict.values() when appropriate (#42509) --- homeassistant/components/apns/notify.py | 2 +- homeassistant/components/netio/switch.py | 2 +- homeassistant/components/scsgate/cover.py | 2 +- homeassistant/components/scsgate/light.py | 2 +- homeassistant/components/scsgate/switch.py | 4 ++-- homeassistant/components/wirelesstag/switch.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/apns/notify.py b/homeassistant/components/apns/notify.py index 24d666fa59b..6f8de7e9c84 100644 --- a/homeassistant/components/apns/notify.py +++ b/homeassistant/components/apns/notify.py @@ -186,7 +186,7 @@ class ApnsNotificationService(BaseNotificationService): def write_devices(self): """Write all known devices to file.""" with open(self.yaml_path, "w+") as out: - for _, device in self.devices.items(): + for device in self.devices.values(): _write_device(out, device) def register(self, call): diff --git a/homeassistant/components/netio/switch.py b/homeassistant/components/netio/switch.py index 08a5b7df862..3c1482844ad 100644 --- a/homeassistant/components/netio/switch.py +++ b/homeassistant/components/netio/switch.py @@ -79,7 +79,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): def dispose(event): """Close connections to Netio Devices.""" - for _, value in DEVICES.items(): + for value in DEVICES.values(): value.netio.stop() diff --git a/homeassistant/components/scsgate/cover.py b/homeassistant/components/scsgate/cover.py index e5442226d80..2b7615bb780 100644 --- a/homeassistant/components/scsgate/cover.py +++ b/homeassistant/components/scsgate/cover.py @@ -27,7 +27,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): scsgate = hass.data[DOMAIN] if devices: - for _, entity_info in devices.items(): + for entity_info in devices.values(): if entity_info[CONF_SCS_ID] in scsgate.devices: continue diff --git a/homeassistant/components/scsgate/light.py b/homeassistant/components/scsgate/light.py index 949041534a8..cf5488c132e 100644 --- a/homeassistant/components/scsgate/light.py +++ b/homeassistant/components/scsgate/light.py @@ -23,7 +23,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): scsgate = hass.data[DOMAIN] if devices: - for _, entity_info in devices.items(): + for entity_info in devices.values(): if entity_info[CONF_SCS_ID] in scsgate.devices: continue diff --git a/homeassistant/components/scsgate/switch.py b/homeassistant/components/scsgate/switch.py index da69eb0b058..f5719aa24dc 100644 --- a/homeassistant/components/scsgate/switch.py +++ b/homeassistant/components/scsgate/switch.py @@ -42,7 +42,7 @@ def _setup_traditional_switches(logger, config, scsgate, add_entities_callback): switches = [] if traditional: - for _, entity_info in traditional.items(): + for entity_info in traditional.values(): if entity_info[CONF_SCS_ID] in scsgate.devices: continue @@ -65,7 +65,7 @@ def _setup_scenario_switches(logger, config, scsgate, hass): scenario = config.get(CONF_SCENARIO) if scenario: - for _, entity_info in scenario.items(): + for entity_info in scenario.values(): if entity_info[CONF_SCS_ID] in scsgate.devices: continue diff --git a/homeassistant/components/wirelesstag/switch.py b/homeassistant/components/wirelesstag/switch.py index 11a5308d8d9..5866893888f 100644 --- a/homeassistant/components/wirelesstag/switch.py +++ b/homeassistant/components/wirelesstag/switch.py @@ -38,7 +38,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): switches = [] tags = platform.load_tags() for switch_type in config.get(CONF_MONITORED_CONDITIONS): - for _, tag in tags.items(): + for tag in tags.values(): if switch_type in tag.allowed_monitoring_types: switches.append(WirelessTagSwitch(platform, tag, switch_type))