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

Hue emulation: Fixes (user creation, storage service, turn light white) #4339

Merged
merged 1 commit into from Dec 9, 2018

Conversation

davidgraeff
Copy link
Member

@davidgraeff davidgraeff commented Dec 8, 2018

Fixes:

  • Fix user creation without a proposed username in the request. Incl. test
  • Fix: The hue value was wrongly applied to the saturation field. Incl. test
  • Fix usage of StorageService: Set the classloader
  • Set the saturation to 0 if a ct (color temperature) value is set.
    This is because Alexa only sets "ct" if you command her to turn the light white.
  • Only call writeToFile in LightItems once, after all items have been
    loaded up from the registry.
  • Don't load items twice from the registry.
  • Reload items whenever the tags configuration has changed.
  • Allow group items

Features:

  • Add troubleshoot section to readme.
    Allow a pretty printed output for /api/{username}/lights?debug=true.

Tests:

  • Add LightItems class unit tests for adding/updating items and group items
    by category and tags.
  • Add tests for setting the hue and saturation and turn a light from color to white

Refactor:

  • Move UserAuth class out of DataStore into own HueUserAuth class

Fixes #4293
Fixes #4307

Signed-off-by: David Graeff david.graeff@web.de

@davidgraeff davidgraeff changed the title Hue emulation: Fix user creation without a proposed username incl. test Hue emulation: Fixes (user creation, storage service, turn light white) Dec 8, 2018
@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/new-binding-hue-emulator-amazon-echo-integration/7944/210

@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/hue-emulation-items-with-switchable-tag-are-not-discovered/58250/12

…, group items

Fixes:
* Fix user creation without a proposed username in the request. Incl. test
* Fix: The hue value was wrongly applied to the saturation field. Incl. test
* Fix usage of StorageService: Set the classloader
* Set the saturation to 0 if a ct (color temperature) value is set.
  This is because Alexa only sets "ct" if you command her to turn the light white.
* Only call writeToFile in LightItems once, after all items have been
  loaded up from the registry.
* Don't load items twice from the registry.
* Reload items whenever the tags configuration has changed.
* Allow group items

Features:
* Add troubleshoot section to readme.
  Allow a pretty printed output for /api/{username}/lights?debug=true.
* Add REST API POST support on /api/{username}/groups.

Tests:
* Add LightItems class unit tests for adding/updating items and group items
  by category and tags.
* Add tests for setting the hue and saturation and turn a light from color to white

Refactor:
* Move UserAuth class out of DataStore into own HueUserAuth class

Fixes openhab#4293
Fixes openhab#4307

Signed-off-by: David Graeff <david.graeff@web.de>
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

I hope this is gettting stable now, the 2.4 release is near!

@kaikreuzer kaikreuzer merged commit 98bdd50 into openhab:master Dec 9, 2018
@davidgraeff
Copy link
Member Author

That's why I keep extending the test suits and have covered almost everything by now.
But I noticed one thing an hour ago. Sporadically POST requests are failing and I have found out why.

I'm using getParameter of HttpServletRequest right at the beginning, which opens the input stream to the content body, and then req.getReader() later on fails (sometimes sigh).

I was just going to force push a change. I'll do another short PR then.

@martinvw martinvw added this to the 2.4 milestone Dec 9, 2018
@davidgraeff davidgraeff deleted the fixhue2 branch December 9, 2018 22:21
limdul79 pushed a commit to limdul79/openhab2-addons that referenced this pull request Dec 23, 2018
…, group items (openhab#4339)

Fixes:
* Fix user creation without a proposed username in the request. Incl. test
* Fix: The hue value was wrongly applied to the saturation field. Incl. test
* Fix usage of StorageService: Set the classloader
* Set the saturation to 0 if a ct (color temperature) value is set.
  This is because Alexa only sets "ct" if you command her to turn the light white.
* Only call writeToFile in LightItems once, after all items have been
  loaded up from the registry.
* Don't load items twice from the registry.
* Reload items whenever the tags configuration has changed.
* Allow group items

Features:
* Add troubleshoot section to readme.
  Allow a pretty printed output for /api/{username}/lights?debug=true.
* Add REST API POST support on /api/{username}/groups.

Tests:
* Add LightItems class unit tests for adding/updating items and group items
  by category and tags.
* Add tests for setting the hue and saturation and turn a light from color to white

Refactor:
* Move UserAuth class out of DataStore into own HueUserAuth class

Fixes openhab#4293
Fixes openhab#4307

Signed-off-by: David Graeff <david.graeff@web.de>
limdul79 pushed a commit to limdul79/openhab2-addons that referenced this pull request Dec 23, 2018
…, group items (openhab#4339)

Fixes:
* Fix user creation without a proposed username in the request. Incl. test
* Fix: The hue value was wrongly applied to the saturation field. Incl. test
* Fix usage of StorageService: Set the classloader
* Set the saturation to 0 if a ct (color temperature) value is set.
  This is because Alexa only sets "ct" if you command her to turn the light white.
* Only call writeToFile in LightItems once, after all items have been
  loaded up from the registry.
* Don't load items twice from the registry.
* Reload items whenever the tags configuration has changed.
* Allow group items

Features:
* Add troubleshoot section to readme.
  Allow a pretty printed output for /api/{username}/lights?debug=true.
* Add REST API POST support on /api/{username}/groups.

Tests:
* Add LightItems class unit tests for adding/updating items and group items
  by category and tags.
* Add tests for setting the hue and saturation and turn a light from color to white

Refactor:
* Move UserAuth class out of DataStore into own HueUserAuth class

Fixes openhab#4293
Fixes openhab#4307

Signed-off-by: David Graeff <david.graeff@web.de>
chaton78 pushed a commit to chaton78/openhab-addons that referenced this pull request Jan 1, 2019
…, group items (openhab#4339)

Fixes:
* Fix user creation without a proposed username in the request. Incl. test
* Fix: The hue value was wrongly applied to the saturation field. Incl. test
* Fix usage of StorageService: Set the classloader
* Set the saturation to 0 if a ct (color temperature) value is set.
  This is because Alexa only sets "ct" if you command her to turn the light white.
* Only call writeToFile in LightItems once, after all items have been
  loaded up from the registry.
* Don't load items twice from the registry.
* Reload items whenever the tags configuration has changed.
* Allow group items

Features:
* Add troubleshoot section to readme.
  Allow a pretty printed output for /api/{username}/lights?debug=true.
* Add REST API POST support on /api/{username}/groups.

Tests:
* Add LightItems class unit tests for adding/updating items and group items
  by category and tags.
* Add tests for setting the hue and saturation and turn a light from color to white

Refactor:
* Move UserAuth class out of DataStore into own HueUserAuth class

Fixes openhab#4293
Fixes openhab#4307

Signed-off-by: David Graeff <david.graeff@web.de>
Signed-off-by: Pascal Larin <plarin@gmail.com>
ne0h pushed a commit to ne0h/openhab-addons that referenced this pull request Sep 15, 2019
…, group items (openhab#4339)

Fixes:
* Fix user creation without a proposed username in the request. Incl. test
* Fix: The hue value was wrongly applied to the saturation field. Incl. test
* Fix usage of StorageService: Set the classloader
* Set the saturation to 0 if a ct (color temperature) value is set.
  This is because Alexa only sets "ct" if you command her to turn the light white.
* Only call writeToFile in LightItems once, after all items have been
  loaded up from the registry.
* Don't load items twice from the registry.
* Reload items whenever the tags configuration has changed.
* Allow group items

Features:
* Add troubleshoot section to readme.
  Allow a pretty printed output for /api/{username}/lights?debug=true.
* Add REST API POST support on /api/{username}/groups.

Tests:
* Add LightItems class unit tests for adding/updating items and group items
  by category and tags.
* Add tests for setting the hue and saturation and turn a light from color to white

Refactor:
* Move UserAuth class out of DataStore into own HueUserAuth class

Fixes openhab#4293
Fixes openhab#4307

Signed-off-by: David Graeff <david.graeff@web.de>
Signed-off-by: Maximilian Hess <mail@ne0h.de>
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

4 participants