Fix xiaomi default gateway in services (#20623)

When xiaomi_aqara services with one gateway, the default should be set
to the sid of the gateway, not the python object itself, otherwise the
call fails.
This commit is contained in:
Thomas Hervé 2019-02-01 06:59:31 +01:00 committed by Anders Melchiorsen
parent 74794102c8
commit 5f930debd4

View File

@ -324,7 +324,7 @@ def _add_gateway_to_schema(xiaomi, schema):
# If the user has only 1 gateway, make it the default for services.
if len(gateways) == 1:
kwargs['default'] = gateways[0]
kwargs['default'] = gateways[0].sid
return schema.extend({
vol.Required(ATTR_GW_MAC, **kwargs): gateway