Hello,
I’ve started working on improving the Philips Hue scan by:
adding the N-UPnP scan (but this requires an additional request to retrieve the serial number)
adding the ability to enter an IP address manually from the front end
I need help with 3 things:
the design of the front-end form. I tried it in a card, in a form, it’s still ugly
I can’t set a value bridge.ipaddress from an input and use it later. It seems basic but I’m stuck (in SetupTab.jsx)
I can’t test it for real because I don’t have a Philips Hue bridge anymore
The branch is here: feat(philips-hue): N-UPnP Search + manual configuration from IP · cicoub13/Gladys@df3fe52 · GitHub
Ah yes, it’s noted in the documentation that the N-UPnP scan only works if the bridge has been registered in the official app. We should add that to our documentation as a prerequisite.
Hi @cicoub13 So cool, thanks for the PR!
Maybe you could reuse the format we have on the other integrations?
A « + » button next to « Search on the network », which would add a card (take inspiration from the design of the other device cards)
I recommend reading code from other places in Gladys to understand
Example for the dashboard page, we create a function: Gladys/front/src/routes/dashboard/index.js at master · GladysAssistant/Gladys · GitHub
Which is then passed as props to the component: Gladys/front/src/routes/dashboard/index.js at master · GladysAssistant/Gladys · GitHub
If you’re new to Preact/React, maybe doing a tutorial could help?
React’s documentation is really well done and there is an interactive tutorial: Quick Start – React
For that we’ll find someone who has one as soon as the PR is ready!
Good news,
I had reported the detection problem a long time ago.
For some it worked well and for others not at all.
The frontend and backend are working
An image is available to test:
Scanning and adding still work
N-UPnP scan works for people who previously had issues
Manual IP addition works
Device control (lights) still works (because I tweaked the storage of the bridge configurations a bit)
docker pull cicoub13/gladys:philips-hue-improve-scan
1 Like
@cicoub13 Super cool, glad you were able to find what wasn’t working on the front end
Maybe post a message on the EN forum — maybe the user who had the issue can do some testing too!
1 Like
Nice tutorial on running a Docker image! Thanks for taking the time
PR ready (tested by an English-speaking user)
master ← cicoub13:feat-philips-hue-improve-scan
ouvert 10:52AM - 30 Oct 23 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fa… st as possible, make sure to review and check all of these items:
- [x] If your changes affects code, did your write the tests?
- [x] Are tests passing? (`npm test` on both front/server)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (`npm run prettier` on both front/server)
- [x] If you are adding a new features/services, did you run integration comparator? (`npm run compare-translations` on front)
- [x] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community ([french forum](https://community.gladysassistant.com/)/[english forum](https://en-community.gladysassistant.com/)) for testing before merging.
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See [the GitHub repo](https://github.com/GladysAssistant/v4-website) and the [website](https://gladysassistant.com).
- [ ] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend? (if needed) See [https://demo.gladysassistant.com](https://demo.gladysassistant.com).
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
### Description of change
Following multiple issues about Philips Hue discovery, this PR allow to:
- Enable both N-UPnP and UPnP search
- Allow user to manually enter Philips Hue local bridge IP address to configure it
TODO:
- Improve documentation (to explain that bridge should be registered through Philips Hue Application before using N-UPnP search)
- Improve documentation to add the manual configuration
- Ask for users to do real test use cases (Docker image under build)
1 Like
@cicoub13 Excellent work, it’s good for me and it’s been merged into master
3 Likes