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

This commit is contained in:
Franck Nijhof
2020-06-26 02:09:52 +02:00
committed by GitHub
parent 98a388e65a
commit f42eb0d5ca
10 changed files with 66 additions and 23 deletions

View File

@@ -84,14 +84,22 @@ class LightSwitch(LightEntity):
"""Forward the turn_on command to the switch in this light switch."""
data = {ATTR_ENTITY_ID: self._switch_entity_id}
await self.hass.services.async_call(
switch.DOMAIN, switch.SERVICE_TURN_ON, data, blocking=True
switch.DOMAIN,
switch.SERVICE_TURN_ON,
data,
blocking=True,
context=self._context,
)
async def async_turn_off(self, **kwargs):
"""Forward the turn_off command to the switch in this light switch."""
data = {ATTR_ENTITY_ID: self._switch_entity_id}
await self.hass.services.async_call(
switch.DOMAIN, switch.SERVICE_TURN_OFF, data, blocking=True
switch.DOMAIN,
switch.SERVICE_TURN_OFF,
data,
blocking=True,
context=self._context,
)
async def async_update(self):