"TypeError: write_to_hub() takes 2 positional arguments but 4 were given" fixed. (#9174)
This commit is contained in:
parent
bf315da8df
commit
de48d42f33
1 changed files with 6 additions and 6 deletions
|
@ -24,10 +24,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
|
||||||
|
|
||||||
class XiaomiGenericCover(XiaomiDevice, CoverDevice):
|
class XiaomiGenericCover(XiaomiDevice, CoverDevice):
|
||||||
"""Representation of a XiaomiPlug."""
|
"""Representation of a XiaomiGenericCover."""
|
||||||
|
|
||||||
def __init__(self, device, name, data_key, xiaomi_hub):
|
def __init__(self, device, name, data_key, xiaomi_hub):
|
||||||
"""Initialize the XiaomiPlug."""
|
"""Initialize the XiaomiGenericCover."""
|
||||||
self._data_key = data_key
|
self._data_key = data_key
|
||||||
self._pos = 0
|
self._pos = 0
|
||||||
XiaomiDevice.__init__(self, device, name, xiaomi_hub)
|
XiaomiDevice.__init__(self, device, name, xiaomi_hub)
|
||||||
|
@ -44,19 +44,19 @@ class XiaomiGenericCover(XiaomiDevice, CoverDevice):
|
||||||
|
|
||||||
def close_cover(self, **kwargs):
|
def close_cover(self, **kwargs):
|
||||||
"""Close the cover."""
|
"""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):
|
def open_cover(self, **kwargs):
|
||||||
"""Open the cover."""
|
"""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):
|
def stop_cover(self, **kwargs):
|
||||||
"""Stop the cover."""
|
"""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):
|
def set_cover_position(self, position, **kwargs):
|
||||||
"""Move the cover to a specific position."""
|
"""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):
|
def parse_data(self, data):
|
||||||
"""Parse data sent by gateway."""
|
"""Parse data sent by gateway."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue