From 130721e8e397b4ab276fd1960d2c959d7c6306fe Mon Sep 17 00:00:00 2001 From: Jon Maddox Date: Thu, 8 Mar 2018 10:14:45 -0500 Subject: [PATCH] use a generator expression --- homeassistant/components/media_player/channels.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/media_player/channels.py b/homeassistant/components/media_player/channels.py index 0090b8106eb..a444610669e 100644 --- a/homeassistant/components/media_player/channels.py +++ b/homeassistant/components/media_player/channels.py @@ -72,8 +72,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): """Handler for services.""" entity_id = service.data.get(ATTR_ENTITY_ID) - device = next([device for device in hass.data[DATA_CHANNELS] if - device.entity_id == entity_id].__iter__(), None) + device = next((device for device in hass.data[DATA_CHANNELS] if + device.entity_id == entity_id), None) if device is None: _LOGGER.warning("Unable to find Channels with entity_id: %s",