Open frenck opened 5 years ago
Sonoff will optimize this in the next firmware, the deviceid is a must but not unneeded in payload. Now it is the bug in firmware
Could you please elaborate a bit more on why this is a required field?
This issue is about the HTTP API, which means, the client is talking to the device directly by IP (which is uniquely identified at that point).
What does the deviceid
parameter add to the HTTP API? The current firmware shows, it is not needed for the HTTP API. So why is this required on the HTTP API?
In DIY mode, one will talk directly to the right device. The
deviceid
in the payload, is therefore not needed.This is even more clear when making requests with other/invalid
deviceid
's, since it still works.Examples:
However, if the
deviceid
is missing in the request, it response with an error:Conclusion: the
deviceid
field is a useless field in DIY mode. Please just remove it (or make it optional to remain backwards compatible).