Traceback (most recent call last):


 "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1018, in _event_to_service_call

yield from self._hass.async_add_job(execute_service)


 "/usr/local/lib/python3.6/asyncio/futures.py", line 327, in __iter__

yield self
# This tells Task to wait for completion.


 "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup

future.result()


 "/usr/local/lib/python3.6/asyncio/futures.py", line 243, in result

raise self._exception


 "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run

result = self.fn(*self.args, **self.kwargs)


 "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1015, in execute_service

service_handler.func(service_call)


 "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/xiaomi_aqara.py", line 146, in play_ringtone_service

gateway.write_to_hub(gateway.sid, **kwargs)


 "/srv/homeassistant/lib/python3.6/site-packages/xiaomi_gateway/__init__.py", line 303, in write_to_hub

'Invalid key' not in resp['data']['error']):
TypeError: string indices must be integers

Traceback (most recent call last):


 "/home/colin/.local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 419, in _async_add_entity

await entity.async_update_ha_state()


 "/home/colin/.local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 284, in async_update_ha_state

self._async_write_ha_state()


 "/home/colin/.local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 314, in _async_write_ha_state

attr = self.capability_attributes


 "/home/colin/.local/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py", line 791, in capability_attributes

if supported_features & SUPPORT_SELECT_SOURCE:
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'
