Ok, I implemented it this morning!
I took the opportunity to strengthen the integration’s robustness, because there were instabilities that became even more apparent with this new feature.
Notably the stopped-container bug: until now, in Gladys, if the Zigbee2mqtt container was already stopped, a 304 error was issued and we never proceeded to remove the container. It’s fixed for all integrations
I tested many cases locally on a mini-PC, and it works really well!
Screenshots:
The PR:
master ← zigbee2mqtt-reset-button
ouvert 08:11AM - 06 Mar 26 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 affect the code, did you 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 feature/service, did you run the 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 ([forum](https://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)
### Description of change
Implement https://community.gladysassistant.com/t/bouton-pour-reinitialiser-lintegration-zigbee2mqtt/10097
## Summary by CodeRabbit
* **New Features**
* Factory-reset for Zigbee2MQTT with a two-step confirmation flow (visible in local mode)
* New user-facing reset UI strings in English, French and German
* Reset action available from the integration setup (admin only)
* **Bug Fixes**
* Corrected i18n/JSON formatting for Zigbee2MQTT messages and links
* More robust cleanup handling so reset/disconnect proceeds even if containers are already stopped
* **Tests**
* Added API and unit tests covering the reset endpoint and workflow
The Docker image:
gladysassistant/gladys:zigbee2mqtt-reset-button
(Already built on x64, being built for arm64)
I’ll do a release this afternoon, if you want to test before then it’s possible
1 Like