-
Notifications
You must be signed in to change notification settings - Fork 60
new cover options #79
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,3 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done ;)
haaska.py
Outdated
@@ -452,6 +452,14 @@ def turn_on(self): | |||
def turn_off(self): | |||
self._call_service('cover/close_cover') | |||
|
|||
def set_percentage(self, val): | |||
self._call_service('cover/set_cover_position', {'position':val}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haaska.py:456:67: E231 missing whitespace after ':'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
haaska.py
Outdated
@@ -452,6 +452,14 @@ def turn_on(self): | |||
def turn_off(self): | |||
self._call_service('cover/close_cover') | |||
|
|||
def set_percentage(self, val): | |||
self._call_service('cover/set_cover_position', {'position':val}) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haaska.py:457:1: W293 blank line contains whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
now, everything is fine ;) |
|
||
def get_percentage(self): | ||
state = self.ha.get('states/' + self.entity_id) | ||
value = int(state['current_position']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all covers report their current_position (specifically Somfy zwave blinds). I'm doing a terrible hack to make this work on my system:
def get_percentage(self):
return 50
def set_percentage(self, val):
if val > 50:
self._call_service('cover/open_cover')
if val < 50:
self._call_service('cover/close_cover')
Definitely not saying to do that but you need to check if current_position
is None to be safe here.
Any ideas on how to implement stop cover? My patio awning never need to extend fully, needs a stop command badly. |
Added Cover Position to haaska