| 120 | } |
| 121 | |
| 122 | std::string NanoleafController::Pair(std::string address, int port) |
| 123 | { |
| 124 | const std::string location = address+":"+std::to_string(port); |
| 125 | |
| 126 | json data; |
| 127 | if(APIRequest("POST", location, "/api/v1/new", nullptr, &data) == 200) |
| 128 | { |
| 129 | return data["auth_token"]; |
| 130 | } |
| 131 | else |
| 132 | { |
| 133 | throw std::exception(); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void NanoleafController::Unpair(std::string address, int port, std::string auth_token) |
| 138 | { |
nothing calls this directly
no test coverage detected