Skip to content
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

Update shade support #11

Merged
merged 3 commits into from
Jun 8, 2023
Merged

Update shade support #11

merged 3 commits into from
Jun 8, 2023

Conversation

alexbrasetvik
Copy link
Contributor

First, thanks for the great work, @jankrib :)

I have two different kinds of shades. Both types would react to the move_down operation, but not the two other operations, where I found the state constants sent to differ from those that the public app makes.

Some of my shades support setting a direct position, e.g. 50%, while some of the other shades do not. I think the logic for detecting this should be right, but hard to tell through reverse engineering and guessing :)

@jankrib Does the existing code move shades correctly for you? If so we'll need to detect differences in components/state somehow so my changes do not break things.

Here's the raw component data I get on an awning shade not supporting setting a direct position:

raw_component = {'compId': 8694179, 'compType': 86, 'name': 'Pergola - høyre', 'icon': 637, 'order': 72, 'versionFW': '7.1', 'info': [{'text': '1111', 'type': 2, 'icon': 1, 'value': '3'}, {'text': '1119', 'type': 2, 'icon': 1}]}
raw_state = {'deviceId': 10219, 'name': 'Pergola - høyre', 'icon': 633, 'order': 113, 'compId': 8694179, 'chId': 0, 'cat': 0, 'devType': 102, 'configured': True, 'shType': 3, 'shControl': 3, 'shRuntime': 60, 'shCounterRuntime': 5000, 'shStepDur': 300, 'shSafety': 0, 'shSafetyPos': 0, 'shCounterPause': 800, 'shHasSlats': False, 'shSlatRuntime': 300, 'shInvertOutput': False, 'curstate': 1, 'shPos': 100, 'shSlatPos': 255, 'shCalInfo': 0, 'cloudUsage': True, 'info': [{'text': '1109', 'type': 2, 'icon': 1, 'value': '30'}, {'text': '1132', 'type': 1, 'value': '100%'}]}

This one does support setting a position, e.g. 50% closed:

raw_component = {'compId': 8627654, 'compType': 86, 'name': 'Screen 4 - høyre vindu', 'icon': 637, 'order': 50, 'versionFW': '7.1', 'info': [{'text': '1111', 'type': 2, 'icon': 1, 'value': '2'}, {'text': '1119', 'type': 2, 'icon': 1}]}
raw_state = {'deviceId': 190, 'name': 'Screen 4 - høyre vindu', 'icon': 631, 'order': 71, 'compId': 8627654, 'chId': 0, 'cat': 0, 'devType': 102, 'configured': True, 'shType': 1, 'shControl': 2, 'shRuntime': 1, 'shCounterRuntime': 5000, 'shStepDur': 300, 'shSafety': 0, 'shSafetyPos': 0, 'shCounterPause': 800, 'shHasSlats': False, 'shSlatRuntime': 0, 'shInvertOutput': False, 'curstate': 1, 'shPos': 100, 'shSlatPos': 255, 'shCalInfo': 1, 'cloudUsage': True, 'info': [{'text': '1109', 'type': 2, 'icon': 1, 'value': '41'}, {'text': '1132', 'type': 1, 'value': '100%'}]}

Copy link
Owner

@jankrib jankrib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't have a cover myself, so I was coding blind. Thank you for contributing. Let's get this in

@jankrib jankrib merged commit 208e17d into jankrib:master Jun 8, 2023
@alexbrasetvik
Copy link
Contributor Author

Awesome. Thanks for the quick follow-up :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants