itead / Sonoff_Devices_DIY_Tools

BSD 3-Clause "New" or "Revised" License
548 stars 168 forks source link

`zerconf/info` call, is missing signal strength #56

Open frenck opened 4 years ago

frenck commented 4 years ago

The zeroconf/info call contains almost all information about the current state of the device, however, wifi_signal is missing from this (weird enough).

So now I need to make an extra API call to get that information.

Example response from zeroconf/info:

{
    "seq": 6,
    "error": 0,
    "data": "{\"switch\":\"on\",\"startup\":\"off\",\"pulse\":\"off\",\"pulseWidth\":500,\"ssid\":\"sonoffDiy\",\"otaUnlock\":true}"
}

Please add it so all the information can be retrieved in a single call.

Daniel-zhan-itead commented 4 years ago

The Wifi signal is variable all the time, we suggest that use API to call the wifi signal info when you need it.

frenck commented 4 years ago

This is a request for the HTTP API. I'm not asking to publish it on the mDNS records.

Reasoning: If I would try to integrate this device into a home automation system, I would have to make 2 API calls to get all the data (info + wifi_signal), while it could be just a single call.

This is a waste of resources, additional programming and requires double the amount of HTTP calls against the device.

However, I cannot extract reasoning from your answer, since it only consists of a single sentence. Could you elaborate a bit more? Thanks! 👍

Daniel-zhan-itead commented 4 years ago

wifi signal strength info has been added in zeroconf/info in the new firmware.

Daniel