Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from barmazu/knx_0_17_1_integration
Browse files Browse the repository at this point in the history
integrate with latest xknx version - reverted cover directions
  • Loading branch information
nagyrobi authored Mar 7, 2021
2 parents 07ab066 + ac2b18a commit 4491355
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions custom_components/cover_rf_time_based/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def async_close_cover(self, **kwargs):
"""Turn the device close."""
_LOGGER.debug(self._name + ': ' + 'async_close_cover')
self.tc.start_travel_down()
self._target_position = 0
self._target_position = 100

self.start_auto_updater()
await self._async_handle_command(SERVICE_CLOSE_COVER)
Expand All @@ -234,7 +234,7 @@ async def async_open_cover(self, **kwargs):
"""Turn the device open."""
_LOGGER.debug(self._name + ': ' + 'async_open_cover')
self.tc.start_travel_up()
self._target_position = 100
self._target_position = 0

self.start_auto_updater()
await self._async_handle_command(SERVICE_OPEN_COVER)
Expand All @@ -252,9 +252,9 @@ async def set_position(self, position):
_LOGGER.debug(self._name + ': ' + 'set_position :: current_position: %d, new_position: %d',
current_position, position)
command = None
if position < current_position:
if position > current_position:
command = SERVICE_CLOSE_COVER
elif position > current_position:
elif position < current_position:
command = SERVICE_OPEN_COVER
if command is not None:
self.start_auto_updater()
Expand Down Expand Up @@ -298,16 +298,16 @@ async def set_known_action(self, **kwargs):
"""We want to do a few things when we get a position"""
action = kwargs[ATTR_ACTION]
if action not in ["open","close","stop"]:
raise ValueError("action must be one of open, close or cover.")
raise ValueError("action must be one of open, close or stop.")
if action == "stop":
self._handle_my_button()
return
if action == "open":
self.tc.start_travel_up()
self._target_position = 100
self._target_position = 0
if action == "close":
self.tc.start_travel_down()
self._target_position = 0
self._target_position = 100
self.start_auto_updater()

async def set_known_position(self, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/cover_rf_time_based/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"domain": "cover_rf_time_based",
"name": "Cover Time Based RF (trigger script)",
"version": "1.0.5",
"version": "1.0.6",
"documentation": "https://github.com/nagyrobi/home-assistant-custom-components-cover-rf-time-based",
"requirements": [
"xknx==0.9.4"
"xknx==0.17.1"
],
"codeowners": ["@davidramosweb", "@nagyrobi", "@Alfiegerner"]
}

0 comments on commit 4491355

Please sign in to comment.