Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions homeassistant/components/cover/xiaomi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -44,19 +44,19 @@ def is_closed(self):

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."""
Expand Down