mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
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:
parent
74794102c8
commit
5f930debd4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user