Add query data to google assistant diagnostic (#78828)

This commit is contained in:
Joakim Plate 2022-09-20 17:05:10 +02:00 committed by GitHub
parent 4f31f28e67
commit 924bffc7d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 2 deletions

View file

@ -130,6 +130,11 @@ async def async_devices_query(hass, data, payload):
context=data.context,
)
return await async_devices_query_response(hass, data.config, payload_devices)
async def async_devices_query_response(hass, config, payload_devices):
"""Generate the device serialization."""
devices = {}
for device in payload_devices:
devid = device["id"]
@ -139,7 +144,7 @@ async def async_devices_query(hass, data, payload):
devices[devid] = {"online": False}
continue
entity = GoogleEntity(hass, data.config, state)
entity = GoogleEntity(hass, config, state)
try:
devices[devid] = entity.query_serialize()
except Exception: # pylint: disable=broad-except