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

[wled] Abstract json api for better segment support #11509

Merged
merged 16 commits into from
Nov 20, 2021
Merged

Conversation

Skinah
Copy link
Contributor

@Skinah Skinah commented Nov 4, 2021

This PR changes to using the json API which has more features then the older http based API and gets better testing.
New features that the changes also bring:

  • Abstracting the API now allows older firmwares to continue working instead of forcing users to always match firmware to their openHAB core version requirement.
  • Far better support for segments.
  • New channels added for mirror, reverse and segment brightness.
  • Named presets are now supported.
  • TransformTime now presents a default list to choose from in the UI instead of requiring a user to create one.
  • Three colours are now supported.
  • Auto add/remove white channels so the extra channels are not seen for RGB users.

Precompiled jar found at link below or it can be installed via the marketplace:
http://pcmus.com/openhab/wled/
Due to new channels getting added, please delete and re-add the things if you use the UI. If you use textual things then no need to do that.

Signed-off-by: Matthew Skinner matt@pcmus.com

Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
@Skinah Skinah added the enhancement An enhancement or new feature for an existing add-on label Nov 4, 2021
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/wled-binding-newer-json-api-beta/128405/1

Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Matthew Skinner <matt@pcmus.com>
@fwolter fwolter merged commit ec86311 into openhab:main Nov 20, 2021
@fwolter fwolter added this to the 3.2 milestone Nov 20, 2021
@Skinah Skinah deleted the wled branch December 15, 2021 09:20
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
volkmarnissen pushed a commit to volkmarnissen/openhab-addons that referenced this pull request Mar 3, 2022
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Change to json for states


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add 3rd colours.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Segments now mostly work


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* changes to json api fully made


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Mirror and Reverse channels added.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Remove old channels when needed.


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Simplify return

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add support for named presets


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Dont add empty preset 0 to list


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add preset saving with custom names


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Tidy up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Rename function for clarity


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Add more channels

Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Clean up


Signed-off-by: Matthew Skinner <matt@pcmus.com>

* Fix bugs and update readme for new channels


Signed-off-by: Matthew Skinner <matt@pcmus.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants