| 127 | } |
| 128 | |
| 129 | void PhilipsWizController::SetScene(int scene, unsigned char brightness) |
| 130 | { |
| 131 | json command; |
| 132 | |
| 133 | /*------------------------------------------------------------*\ |
| 134 | | Fill in the setPilot command with Scene information. | |
| 135 | \*------------------------------------------------------------*/ |
| 136 | command["method"] = "setPilot"; |
| 137 | command["params"]["sceneId"] = scene; |
| 138 | command["params"]["dimming"] = brightness; |
| 139 | |
| 140 | /*------------------------------------------------------------*\ |
| 141 | | Convert the JSON object to a string and write it | |
| 142 | \*------------------------------------------------------------*/ |
| 143 | std::string command_str = command.dump(); |
| 144 | |
| 145 | port.udp_write((char*)command_str.c_str(), command_str.length() + 1); |
| 146 | } |
| 147 | |
| 148 | void PhilipsWizController::ReceiveThreadFunction() |
| 149 | { |
no test coverage detected