Fix implicit-return in garadget (#122923)
This commit is contained in:
parent
d5388452d4
commit
a23b3f84f0
1 changed files with 3 additions and 6 deletions
|
@ -213,23 +213,20 @@ class GaradgetCover(CoverEntity):
|
||||||
def close_cover(self, **kwargs: Any) -> None:
|
def close_cover(self, **kwargs: Any) -> None:
|
||||||
"""Close the cover."""
|
"""Close the cover."""
|
||||||
if self._state not in ["close", "closing"]:
|
if self._state not in ["close", "closing"]:
|
||||||
ret = self._put_command("setState", "close")
|
self._put_command("setState", "close")
|
||||||
self._start_watcher("close")
|
self._start_watcher("close")
|
||||||
return ret.get("return_value") == 1
|
|
||||||
|
|
||||||
def open_cover(self, **kwargs: Any) -> None:
|
def open_cover(self, **kwargs: Any) -> None:
|
||||||
"""Open the cover."""
|
"""Open the cover."""
|
||||||
if self._state not in ["open", "opening"]:
|
if self._state not in ["open", "opening"]:
|
||||||
ret = self._put_command("setState", "open")
|
self._put_command("setState", "open")
|
||||||
self._start_watcher("open")
|
self._start_watcher("open")
|
||||||
return ret.get("return_value") == 1
|
|
||||||
|
|
||||||
def stop_cover(self, **kwargs: Any) -> None:
|
def stop_cover(self, **kwargs: Any) -> None:
|
||||||
"""Stop the door where it is."""
|
"""Stop the door where it is."""
|
||||||
if self._state not in ["stopped"]:
|
if self._state not in ["stopped"]:
|
||||||
ret = self._put_command("setState", "stop")
|
self._put_command("setState", "stop")
|
||||||
self._start_watcher("stop")
|
self._start_watcher("stop")
|
||||||
return ret["return_value"] == 1
|
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
"""Get updated status from API."""
|
"""Get updated status from API."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue