When developing an external integration, an error “HTTP 422 — UNPROCESSABLE_ENTITY — t_device_feature.min cannot be null; t_device_feature.max cannot be null” consistently occurs when registering a device containing a text feature.
The PRs:
master ← gboulvin:fix/discovered-device-min-max
ouvert 09:35PM - 15 Nov 26 UTC
…tion would refuse
POST /api/integration/v1/discovered_device accepted a featur… e without min / max (typically a text feature), without name, read_only or has_feedback. The Discovery screen listed the device, and the user only got "HTTP 422 t_device_feature.min cannot be null" when clicking "Add", far from the integration's code and its developer.
The host API now checks the NOT NULL columns of t_device_feature that have no default value: a non-empty name, booleans read_only and has_feedback, finite numbers min and max (0 / 0 for a feature without a range). A violation is a 400 naming the feature, like an unknown category or unit, visible in the integration logs at publication.
Spec: contracts/host-api-endpoints.md (POST /discovered_device rules).
Claude-Session: https://claude.ai/code/session_0134kXPPjevuPMP3oEuzaF3m
### Description
### Related request
Forum: https://community.gladysassistant.com/t/min-max-dans-les-valeurs-texte/11593
### Checklist
- [ ] If a forum topic or GitHub issue exists, the description links it (`Forum: https://community.gladysassistant.com/t/...` or `Closes #...`)
- [ ] Tests pass: `cd server && npm run coverage` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [ ] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [ ] No undocumented breaking change
main ← gboulvin:fix/fake-feature-min-max
ouvert 09:32PM - 15 Nov 26 UTC
The fake Gladys accepted a discovered feature without min / max (a text feature,… typically), without name, read_only or has_feedback. Gladys stores those columns as NOT NULL: the device was then refused when the user clicked "Add" on the Discovery screen ("t_device_feature.min cannot be null"), a bug the integration's own tests could never catch.
validateDiscoveredDevices now checks them like the Gladys host API does since GladysAssistant/Gladys (companion PR): a non-empty name, booleans read_only and has_feedback, finite numbers min and max (0 / 0 for a feature without a range). The DeviceFeature typing and the README say so.
Claude-Session: https://claude.ai/code/session_0134kXPPjevuPMP3oEuzaF3m
Forum : https://community.gladysassistant.com/t/min-max-dans-les-valeurs-texte/11593