Fix missing service call context in multiple locations (#37094)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-06-25 17:09:52 -07:00
1 parent 98a388e65a
commit f42eb0d5ca
10 files changed
+66 -23

No files matched your search

+16 -8
View File
@@ -209,21 +209,21 @@ class CoverGroup(CoverEntity):
"""Move the covers up."""
data = {ATTR_ENTITY_ID: self._covers[KEY_OPEN_CLOSE]}
await self.hass.services.async_call(
DOMAIN, SERVICE_OPEN_COVER, data, blocking=True
DOMAIN, SERVICE_OPEN_COVER, data, blocking=True, context=self._context
)
async def async_close_cover(self, **kwargs):
"""Move the covers down."""
data = {ATTR_ENTITY_ID: self._covers[KEY_OPEN_CLOSE]}
await self.hass.services.async_call(
DOMAIN, SERVICE_CLOSE_COVER, data, blocking=True
DOMAIN, SERVICE_CLOSE_COVER, data, blocking=True, context=self._context
)
async def async_stop_cover(self, **kwargs):
"""Fire the stop action."""
data = {ATTR_ENTITY_ID: self._covers[KEY_STOP]}
await self.hass.services.async_call(
DOMAIN, SERVICE_STOP_COVER, data, blocking=True
DOMAIN, SERVICE_STOP_COVER, data, blocking=True, context=self._context
)
async def async_set_cover_position(self, **kwargs):
@@ -233,28 +233,32 @@ class CoverGroup(CoverEntity):
ATTR_POSITION: kwargs[ATTR_POSITION],
}
await self.hass.services.async_call(
DOMAIN, SERVICE_SET_COVER_POSITION, data, blocking=True
DOMAIN,
SERVICE_SET_COVER_POSITION,
data,
blocking=True,
context=self._context,
)
async def async_open_cover_tilt(self, **kwargs):
"""Tilt covers open."""
data = {ATTR_ENTITY_ID: self._tilts[KEY_OPEN_CLOSE]}
await self.hass.services.async_call(
DOMAIN, SERVICE_OPEN_COVER_TILT, data, blocking=True
DOMAIN, SERVICE_OPEN_COVER_TILT, data, blocking=True, context=self._context
)
async def async_close_cover_tilt(self, **kwargs):
"""Tilt covers closed."""
data = {ATTR_ENTITY_ID: self._tilts[KEY_OPEN_CLOSE]}
await self.hass.services.async_call(
DOMAIN, SERVICE_CLOSE_COVER_TILT, data, blocking=True
DOMAIN, SERVICE_CLOSE_COVER_TILT, data, blocking=True, context=self._context
)
async def async_stop_cover_tilt(self, **kwargs):
"""Stop cover tilt."""
data = {ATTR_ENTITY_ID: self._tilts[KEY_STOP]}
await self.hass.services.async_call(
DOMAIN, SERVICE_STOP_COVER_TILT, data, blocking=True
DOMAIN, SERVICE_STOP_COVER_TILT, data, blocking=True, context=self._context
)
async def async_set_cover_tilt_position(self, **kwargs):
@@ -264,7 +268,11 @@ class CoverGroup(CoverEntity):
ATTR_TILT_POSITION: kwargs[ATTR_TILT_POSITION],
}
await self.hass.services.async_call(
DOMAIN, SERVICE_SET_COVER_TILT_POSITION, data, blocking=True
DOMAIN,
SERVICE_SET_COVER_TILT_POSITION,
data,
blocking=True,
context=self._context,
)
async def async_update(self):
+16 -3
View File
@@ -233,7 +233,11 @@ class LightGroup(light.LightEntity):
if not emulate_color_temp_entity_ids:
await self.hass.services.async_call(
light.DOMAIN, light.SERVICE_TURN_ON, data, blocking=True
light.DOMAIN,
light.SERVICE_TURN_ON,
data,
blocking=True,
context=self._context,
)
return
@@ -249,13 +253,18 @@ class LightGroup(light.LightEntity):
await asyncio.gather(
self.hass.services.async_call(
light.DOMAIN, light.SERVICE_TURN_ON, data, blocking=True
light.DOMAIN,
light.SERVICE_TURN_ON,
data,
blocking=True,
context=self._context,
),
self.hass.services.async_call(
light.DOMAIN,
light.SERVICE_TURN_ON,
emulate_color_temp_data,
blocking=True,
context=self._context,
),
)
@@ -267,7 +276,11 @@ class LightGroup(light.LightEntity):
data[ATTR_TRANSITION] = kwargs[ATTR_TRANSITION]
await self.hass.services.async_call(
light.DOMAIN, light.SERVICE_TURN_OFF, data, blocking=True
light.DOMAIN,
light.SERVICE_TURN_OFF,
data,
blocking=True,
context=self._context,
)
async def async_update(self):