-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Blind Tilt support #181
Conversation
Co-authored-by: Ben Morton <ben.morton91@gmail.com>
switchbot/devices/blind_tilt.py
Outdated
def __init__(self, *args: Any, **kwargs: Any) -> None: | ||
"""Switchbot Blind Tilt/woBlindTilt constructor.""" | ||
|
||
super().__init__(*args, **kwargs) | ||
|
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.
def __init__(self, *args: Any, **kwargs: Any) -> None: | |
"""Switchbot Blind Tilt/woBlindTilt constructor.""" | |
super().__init__(*args, **kwargs) |
Looks like a useless constructor?
I'm wondering if it's worth doing Also, should there be another helper method in
|
Add support for discovering curtains in pairing mode Fix calibrated status bit parsing Update default reverse mode to be disabled Add open/close_up/close_down/close blind tilt methods
I did the changes I proposed to add Lib changes: master...BTMorton:pySwitchbot:add_blind_tilt_support It works pretty nicely as an integration as it matches the up/down arrows in the UI. The problem is that the behaviour isn't super intuitive from the cover service naming. Calling "open" when the blind is already open will close the blind up, because the "open" arrow in the UI points up. Likewise when it's closed, calling "close" will open the blind. It makes sense from an interface perspective, but not so much on the automation front. There's potentially a limitation in the base cover tilt implementation in that it doesn't seem to support bi-directional closing. Making an assumption and limiting it to close one-way or the other will upset someone somewhere, although it could be worked around by calibrating the device in reverse. This solution was a "light-touch" way to add full support. I'll leave it to you guys to decide next steps. If this is the wrong place to put this, let me know and I can re-post somewhere more appropriate. |
@BTMorton maybe send a PR to Jesse's branch? |
Please feel free to PR into this branch. I have had no time myself to look into this so I am glad someone is. In regards to the HA side, I did implement it a little, but because this is setting the tilt of a curtain/blind, I made the entity only support tilt, not actual position with open/close functions which better represents what it actually is. Feel free to disagree there. |
Rename variable
Co-authored-by: Ben Morton <ben.morton91@gmail.com>
With the suggestions by @BTMorton merged, this now opens and closes nicely from HA. The default HA frontend controls don't like to allow |
closes #172