| 168 | } |
| 169 | |
| 170 | void 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 | } |
| 187 | void snippet4() |
| 188 | { |
| 189 | // Shared state |
nothing calls this directly
no test coverage detected