From de48d42f33593e412fee8c57f781ba6ab66738b7 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 27 Aug 2017 21:41:47 +0200 Subject: [PATCH] "TypeError: write_to_hub() takes 2 positional arguments but 4 were given" fixed. (#9174) --- homeassistant/components/cover/xiaomi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/cover/xiaomi.py b/homeassistant/components/cover/xiaomi.py index 7e3b0b7044d..d0e7bfa6d7e 100644 --- a/homeassistant/components/cover/xiaomi.py +++ b/homeassistant/components/cover/xiaomi.py @@ -24,10 +24,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class XiaomiGenericCover(XiaomiDevice, CoverDevice): - """Representation of a XiaomiPlug.""" + """Representation of a XiaomiGenericCover.""" def __init__(self, device, name, data_key, xiaomi_hub): - """Initialize the XiaomiPlug.""" + """Initialize the XiaomiGenericCover.""" self._data_key = data_key self._pos = 0 XiaomiDevice.__init__(self, device, name, xiaomi_hub) @@ -44,19 +44,19 @@ class XiaomiGenericCover(XiaomiDevice, CoverDevice): def close_cover(self, **kwargs): """Close the cover.""" - self._write_to_hub(self._sid, self._data_key['status'], 'close') + self._write_to_hub(self._sid, **{self._data_key['status']: 'close'}) def open_cover(self, **kwargs): """Open the cover.""" - self._write_to_hub(self._sid, self._data_key['status'], 'open') + self._write_to_hub(self._sid, **{self._data_key['status']: 'open'}) def stop_cover(self, **kwargs): """Stop the cover.""" - self._write_to_hub(self._sid, self._data_key['status'], 'stop') + self._write_to_hub(self._sid, **{self._data_key['status']: 'stop'}) def set_cover_position(self, position, **kwargs): """Move the cover to a specific position.""" - self._write_to_hub(self._sid, self._data_key['pos'], str(position)) + self._write_to_hub(self._sid, **{self._data_key['pos']: str(position)}) def parse_data(self, data): """Parse data sent by gateway."""