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

Function snippet3

dependencies/hueplusplus-1.0.0/examples/Snippets.cpp:170–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void snippet3()
171{
172 // Shared state
173 auto handler = std::make_shared<hueplusplus::LinHttpHandler>();
174 hueplusplus::BridgeFinder finder(handler);
175 std::vector<hueplusplus::BridgeFinder::BridgeIdentification> bridges = finder.findBridges();
176 //! [shared-bridge-1]
177 hueplusplus::Bridge bridge = finder.getBridge(bridges[0], true);
178 //! [shared-bridge-1]
179 //! [refresh-example]
180 bridge.setRefreshDuration(std::chrono::minutes(1));
181 bridge.lights().setRefreshDuration(std::chrono::seconds(30));
182 hueplusplus::Light light = bridge.lights().get(1);
183 // ... wait some time
184 bool on = light.isOn();
185 //! [refresh-example]
186}
187void snippet4()
188{
189 // Shared state

Callers

nothing calls this directly

Calls 5

findBridgesMethod · 0.80
getBridgeMethod · 0.80
setRefreshDurationMethod · 0.45
getMethod · 0.45
isOnMethod · 0.45

Tested by

no test coverage detected