Context (#15674)
* Add context * Add context to switch/light services * Test set_state API * Lint * Fix tests * Do not include context yet in comparison * Do not pass in loop * Fix Z-Wave tests * Add websocket test without user
This commit is contained in:
1 parent
867f80715e
commit
c7f4bdafc0
16 files changed
+363
-109
No files matched your search
@@ -179,7 +179,7 @@ class Entity:
|
||||
# produce undesirable effects in the entity's operation.
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_update_ha_state(self, force_refresh=False):
|
||||
def async_update_ha_state(self, force_refresh=False, context=None):
|
||||
"""Update Home Assistant with current state of entity.
|
||||
|
||||
If force_refresh == True will update entity before setting state.
|
||||
@@ -279,7 +279,7 @@ class Entity:
|
||||
pass
|
||||
|
||||
self.hass.states.async_set(
|
||||
self.entity_id, state, attr, self.force_update)
|
||||
self.entity_id, state, attr, self.force_update, context)
|
||||
|
||||
def schedule_update_ha_state(self, force_refresh=False):
|
||||
"""Schedule an update ha state change task.
|
||||
|
||||
Reference in new issue
Block a user