Open olavt opened 1 year ago
The API is not case sensitive as far as I have seen so far
Ok, but it should be consistent according to the documentation. It gets error prone if one needs to make sure any comparison is done case insensitive.
Its hard to dissagree that documentation and code should be consistent 😉 I just wanted to inform you about how the API behaves, but the documentation should be updated. You are free to make a PR with suggested modifications!
Btw, why is "status": "ok" returned when setting EOprationMode to invalid values? I also didn't understand the "Invalid" entry in the documentation for EOprationMode.
Good point, setting invalid Operation Mode should lead to HTTP 400 and another status value. Im not sure why API has introduced a status property in response body, in stead of using standardised HTTP status codes. I made a issue on this: https://github.com/Mill-International-AS/Generation_3_REST_API/issues/10
The documentation states that "Off" is a valid value for EOprationMode (which is also misspelled).
The heater actually does return "OFF" as a response to /control-status:
{ "ambient_temperature": 21.177026748657227, "current_power": 0, "control_signal": 0, "lock_active": "No lock", "open_window_active_now": "Enabled not active now", "raw_ambient_temperature": 21.177026748657227, "set_temperature": 0, "switched_on": false, "connected_to_cloud": true, "operation_mode": "OFF", "status": "ok" }