itead / Sonoff_Devices_DIY_Tools

BSD 3-Clause "New" or "Revised" License
558 stars 166 forks source link

Device ID in payload seems to be unneeded, remove it. #54

Open frenck opened 5 years ago

frenck commented 5 years ago

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:

image

image

However, if the deviceid is missing in the request, it response with an error:

image

Conclusion: the deviceid field is a useless field in DIY mode. Please just remove it (or make it optional to remain backwards compatible).

Daniel-zhan-itead commented 4 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

frenck commented 4 years ago

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?