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

updating field names for 'Group' and added a new 'Edit' interface #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bloomiboy
Copy link

The field names have been updated to unmarshall correctly. I've kept the mnemonic names to make it more readable.

Screenshot 2020-12-01 at 4 31 57 PM

@bloomiboy bloomiboy force-pushed the master branch 2 times, most recently from 21145af to 1a31ef3 Compare December 2, 2020 02:20
@bloomiboy bloomiboy changed the title updating field names for 'Group' updating field names for 'Group' and added a new 'Edit' interface Dec 2, 2020
@scottlamb
Copy link
Owner

Odd - it's been a while since I've used this piece of code, but I'm fairly sure this code worked as-is when I wrote it. Which means that (1) I was completely mistaken (bit hard to believe) (2) you are completely mistaken now (likewise), (3) they've changed the API incompatibly (sadly believable but I'd like to confirm), or (4) it differs product-by-product.

I'd like to test this out on my own controller before merging, but I won't have a chance to play with it until this weekend I think.

@bloomiboy
Copy link
Author

The code "works" for the most part, i.e. there's no error.

The first commit has fixes that "hides" certain fields because of the mismatch in field names. I can't test it over firmware versions, so YMMV.

Background for the second commit: When all 3 Group fields are changed (name, intensity and color) at the same time, the Luxor app makes 2 separate calls in order: (1) GroupListRename to change the name first and (2) uses that changed name as a key inside GroupListEdit to change the intensity + color. This commit adds that second function.

@scottlamb
Copy link
Owner

Sorry, I said I'd look at this like next weekend then I forgot about it for half a year.

I noticed it again today when I was playing with this library. This is taken from a reply from my controller:

{"Status":0,"GroupList":[{"Name":"Japanese maple","GroupNumber":1,"Intensity":0},{"Name":"Front beam (house s","GroupNumber":2,"Intensity":0},{"Name":"Front path","GroupNumber":3,"Intensity":0},{"Name":"Magnolia wall","GroupNumber":4,"Intensity":0},{"Name":"Front alder","GroupNumber":5,"Intensity":0},{"Name":"Side path","GroupNumber":6,"Intensity":0},{"Name":"Birches","GroupNumber":7,"Intensity":0},{"Name":"Back beam","GroupNumber":8,"Intensity":0},{"Name":"Barbeque","GroupNumber":9,"Intensity":0},{"Name":"Back alder","GroupNumber":10,"Intensity":0},{"Name":"Entrance patio - c","GroupNumber":11,"Intensity":0},{"Name":"Fountain Patio","GroupNumber":12,"Intensity":0},{"Name":"Fountain wall - st","GroupNumber":13,"Intensity":0},{"Name":"Path lights - fron","GroupNumber":14,"Intensity":0},{"Name":"Back Beam West","GroupNumber":15,"Intensity":0}]}

I don't see the Grp, Intern, and Color that you do. We must have different versions of the controller, I guess? Maybe mine is older, as I've never updated it. Apparently I havea LUXOR ZD, LZD 300, running facepack version 0.144, chassis version 0.8. I may try updating it later...

@scottlamb
Copy link
Owner

Flashed to the latest firmware for my model: Fpack 0.168, 0.16.

No change. I don't have the abbreviated field names you do, so merging this would make it no longer work for me.

@dcramer
Copy link

dcramer commented Sep 14, 2021

Just noticed this and I also have the abbreviated names on my system. Only seems to be present in the GroupListGet response so far (the theme responses use the full names).

LMK and I can help debug.

Of note I'm converting this to an OpenAPI spec as I need the bindings available in either Python or Typescript: https://github.com/dcramer/luxor-openapi

(I've not really used OpenAPI before, but I'm trying it out as it seems like it'd be more value-add for the world then me just rewriting the spec into TS)

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.

3 participants