Maker Api EndPoint api result gives previous power state when activating a command

Hi, Let,s say i want tu turn on a device with a local (or cloud) api with the following uri:
http://192.168.2.191/apps/api/6/devices/35/on?access_token={my access token}

The api returns a success status and a json structure representing the device infos. the currentValue for the switch device if "off". I would assume "on" since the lamp is turned on by the api call. That api seems to return the previous state of the device instead on the actual one.

Is there a way to get rid of that.to avoir making an other call to get the "real" status of the device?

If you wanted to have the "real" state, you would have to wait until after the command is executed by the device and that isn't always the same for every device. So, from a software perspective, it would be difficult for the maker API to figure out how to wait before capturing the change in attributes before responding to the HTTP GET request that you send it. If the bulb takes 5 seconds to ramp up, do we wait 5 seconds to respond? How do we know when it's safe to capture the attributes again? The Maker API doesn't know what the command it's issuing to the device does, it just forwards it to the driver.

2 Likes