Skip to content

Commit

Permalink
Merge 264f152 into 95da6d4
Browse files Browse the repository at this point in the history
  • Loading branch information
awarecan committed Mar 14, 2019
2 parents 95da6d4 + 264f152 commit 06b3d00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions homeassistant/components/lifx/light.py
Expand Up @@ -24,7 +24,7 @@
import homeassistant.helpers.config_validation as cv
import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.helpers.service import extract_entity_ids
from homeassistant.helpers.service import async_extract_entity_ids
import homeassistant.util.color as color_util

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -250,7 +250,7 @@ def register_set_state(self):
async def service_handler(service):
"""Apply a service."""
tasks = []
for light in self.service_to_entities(service):
for light in await self.async_service_to_entities(service):
if service.service == SERVICE_LIFX_SET_STATE:
task = light.set_state(**service.data)
tasks.append(self.hass.async_create_task(task))
Expand All @@ -265,7 +265,7 @@ def register_effects(self):
"""Register the LIFX effects as hass service calls."""
async def service_handler(service):
"""Apply a service, i.e. start an effect."""
entities = self.service_to_entities(service)
entities = await self.async_service_to_entities(service)
if entities:
await self.start_effect(
entities, service.service, **service.data)
Expand Down Expand Up @@ -314,9 +314,9 @@ async def start_effect(self, entities, service, **kwargs):
elif service == SERVICE_EFFECT_STOP:
await self.effects_conductor.stop(bulbs)

def service_to_entities(self, service):
async def async_service_to_entities(self, service):
"""Return the known entities that a service call mentions."""
entity_ids = extract_entity_ids(self.hass, service)
entity_ids = await async_extract_entity_ids(self.hass, service)
if entity_ids:
entities = [entity for entity in self.entities.values()
if entity.entity_id in entity_ids]
Expand Down

0 comments on commit 06b3d00

Please sign in to comment.