From 5f930debd4d3733a1441c1a3cc4988eaa15f3076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Fri, 1 Feb 2019 06:59:31 +0100 Subject: [PATCH] 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. --- homeassistant/components/xiaomi_aqara.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/xiaomi_aqara.py b/homeassistant/components/xiaomi_aqara.py index 25e7a72db90..ca2d8c1a169 100644 --- a/homeassistant/components/xiaomi_aqara.py +++ b/homeassistant/components/xiaomi_aqara.py @@ -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