Do not include unavailable entities in Google Assistant SYNC (#13358)
This commit is contained in:
1 parent
852eef8046
commit
cfb0b00c0c
3 files changed
+38
-2
No files matched your search
@@ -259,3 +259,31 @@ def test_serialize_input_boolean():
|
||||
'type': 'action.devices.types.SWITCH',
|
||||
'willReportState': False,
|
||||
}
|
||||
|
||||
|
||||
async def test_unavailable_state_doesnt_sync(hass):
|
||||
"""Test that an unavailable entity does not sync over."""
|
||||
light = DemoLight(
|
||||
None, 'Demo Light',
|
||||
state=False,
|
||||
hs_color=(180, 75),
|
||||
)
|
||||
light.hass = hass
|
||||
light.entity_id = 'light.demo_light'
|
||||
light._available = False
|
||||
await light.async_update_ha_state()
|
||||
|
||||
result = await sh.async_handle_message(hass, BASIC_CONFIG, {
|
||||
"requestId": REQ_ID,
|
||||
"inputs": [{
|
||||
"intent": "action.devices.SYNC"
|
||||
}]
|
||||
})
|
||||
|
||||
assert result == {
|
||||
'requestId': REQ_ID,
|
||||
'payload': {
|
||||
'agentUserId': 'test-agent',
|
||||
'devices': []
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user