MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / setCoordinates

Method setCoordinates

dependencies/hueplusplus-1.0.0/src/Sensor.cpp:298–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 sendPutRequest("/config", nlohmann::json {{"battery", percent}}, CURRENT_FILE_INFO);
297}
298void DaylightSensor::setCoordinates(const std::string& latitude, const std::string& longitude)
299{
300 nlohmann::json request {{"lat", latitude}, {"long", longitude}};
301 // Currently, "none" is supposed to be used for reset; may change to null in the future,
302 // so the functionality is implemented already
303 if (latitude.empty())
304 {
305 request["lat"] = nullptr;
306 }
307 if (longitude.empty())
308 {
309 request["long"] = nullptr;
310 }
311 sendPutRequest("/config", request, CURRENT_FILE_INFO);
312}
313bool DaylightSensor::isConfigured() const
314{
315 return state.getValue().at("config").at("configured").get<bool>();

Callers 1

TEST_FFunction · 0.80

Calls 1

emptyMethod · 0.45

Tested by 1

TEST_FFunction · 0.64