5 #include "Lifxtest.hpp"
6 #include "Iterator.hpp"
12 Lifxtest::Lifxtest(IoTSet<LightBulbTest*> _lifx_light_bulb) {
14 lifx_light_bulb = _lifx_light_bulb;
18 Lifxtest::~Lifxtest() {
22 void Lifxtest::init() {
24 unordered_set<LightBulbTest*>* bulbSet = lifx_light_bulb.values();
25 for(LightBulbTest* lifx : *bulbSet) {
28 this_thread::sleep_for (chrono::milliseconds(1000));
30 for (int i = 0; i < 5; i++) {
32 cout << "Turning off!" << endl;
33 this_thread::sleep_for (chrono::milliseconds(1000));
35 cout << "Turning on!" << endl;
36 this_thread::sleep_for (chrono::milliseconds(1000));
39 for (int i = 2500; i < 9000; i += 100) {
40 cout << "Adjusting Temp: ";
41 lifx->setTemperature(i);
42 this_thread::sleep_for (chrono::milliseconds(100));
45 for (int i = 9000; i > 2500; i -= 100) {
46 cout << "Adjusting Temp: ";
47 lifx->setTemperature(i);
48 this_thread::sleep_for (chrono::milliseconds(100));
51 for (int i = 100; i > 0; i -= 10) {
52 cout << "Adjusting Brightness: ";
53 lifx->setColor(lifx->getHue(), lifx->getSaturation(), i);
54 this_thread::sleep_for (chrono::milliseconds(500));
57 for (int i = 0; i < 100; i += 10) {
58 cout << "Adjusting Brightness: " << endl;
59 lifx->setColor(lifx->getHue(), lifx->getSaturation(), i);
60 this_thread::sleep_for (chrono::milliseconds(500));
66 int main(int argc, char *argv[]) {