Commit 8699b01b5a64396f1636172cd9bbf03b426d6790
1 parent
d0bb8757
fixed weird copy paste error
Showing
1 changed file
with
23 additions
and
16 deletions
hueplusplus/HueLight.cpp
| ... | ... | @@ -349,12 +349,12 @@ bool HueTemperatureLight::alertTemperature(unsigned int mired) |
| 349 | 349 | { |
| 350 | 350 | return false; |
| 351 | 351 | } |
| 352 | - std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 352 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 353 | 353 | if (!alert()) |
| 354 | 354 | { |
| 355 | 355 | return false; |
| 356 | 356 | } |
| 357 | - std::this_thread::sleep_for(std::chrono::milliseconds(1300)); | |
| 357 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 358 | 358 | if (!on) |
| 359 | 359 | { |
| 360 | 360 | return OffNoRefresh(1); |
| ... | ... | @@ -668,12 +668,12 @@ bool HueColorLight::alertHueSaturation(uint16_t hue, uint8_t sat) |
| 668 | 668 | { |
| 669 | 669 | return false; |
| 670 | 670 | } |
| 671 | - std::this_thread::sleep_for(std::chrono::milliseconds(300)); | |
| 671 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 672 | 672 | if (!alert()) |
| 673 | 673 | { |
| 674 | 674 | return false; |
| 675 | 675 | } |
| 676 | - std::this_thread::sleep_for(std::chrono::seconds(2)); | |
| 676 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 677 | 677 | if (!on) |
| 678 | 678 | { |
| 679 | 679 | return OffNoRefresh(); |
| ... | ... | @@ -687,17 +687,24 @@ bool HueColorLight::alertHueSaturation(uint16_t hue, uint8_t sat) |
| 687 | 687 | { |
| 688 | 688 | float oldX = state["state"]["xy"][0].asFloat(); |
| 689 | 689 | float oldY = state["state"]["xy"][1].asFloat(); |
| 690 | - if (!setColorHueSaturation(hue, sat)) | |
| 690 | + if (!setColorHueSaturation(hue, sat, 1)) | |
| 691 | 691 | { |
| 692 | 692 | return false; |
| 693 | 693 | } |
| 694 | - std::this_thread::sleep_for(std::chrono::milliseconds(300)); | |
| 694 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 695 | 695 | if (!alert()) |
| 696 | 696 | { |
| 697 | 697 | return false; |
| 698 | 698 | } |
| 699 | - std::this_thread::sleep_for(std::chrono::seconds(2)); | |
| 700 | - return setColorXY(oldX, oldY); | |
| 699 | + std::this_thread::sleep_for(std::chrono::smilliseconds(1500)); | |
| 700 | + if (!on) | |
| 701 | + { | |
| 702 | + return OffNoRefresh(1); | |
| 703 | + } | |
| 704 | + else | |
| 705 | + { | |
| 706 | + return return setColorXY(oldX, oldY, 1); | |
| 707 | + } | |
| 701 | 708 | } |
| 702 | 709 | else |
| 703 | 710 | { |
| ... | ... | @@ -944,12 +951,12 @@ bool HueExtendedColorLight::alertTemperature(unsigned int mired) |
| 944 | 951 | { |
| 945 | 952 | return false; |
| 946 | 953 | } |
| 947 | - std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 954 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 948 | 955 | if (!alert()) |
| 949 | 956 | { |
| 950 | 957 | return false; |
| 951 | 958 | } |
| 952 | - std::this_thread::sleep_for(std::chrono::milliseconds(1300)); | |
| 959 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 953 | 960 | if (!on) |
| 954 | 961 | { |
| 955 | 962 | return OffNoRefresh(1); |
| ... | ... | @@ -1023,12 +1030,12 @@ bool HueExtendedColorLight::alertHueSaturation(uint16_t hue, uint8_t sat) |
| 1023 | 1030 | { |
| 1024 | 1031 | return false; |
| 1025 | 1032 | } |
| 1026 | - std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1033 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 1027 | 1034 | if (!alert()) |
| 1028 | 1035 | { |
| 1029 | 1036 | return false; |
| 1030 | 1037 | } |
| 1031 | - std::this_thread::sleep_for(std::chrono::milliseconds(1300)); | |
| 1038 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1032 | 1039 | if (!on) |
| 1033 | 1040 | { |
| 1034 | 1041 | return OffNoRefresh(1); |
| ... | ... | @@ -1102,12 +1109,12 @@ bool HueExtendedColorLight::alertXY(float x, float y) |
| 1102 | 1109 | { |
| 1103 | 1110 | return false; |
| 1104 | 1111 | } |
| 1105 | - std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1112 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 1106 | 1113 | if (!alert()) |
| 1107 | 1114 | { |
| 1108 | 1115 | return false; |
| 1109 | 1116 | } |
| 1110 | - std::this_thread::sleep_for(std::chrono::milliseconds(1300)); | |
| 1117 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1111 | 1118 | if (!on) |
| 1112 | 1119 | { |
| 1113 | 1120 | return OffNoRefresh(1); |
| ... | ... | @@ -1181,12 +1188,12 @@ bool HueExtendedColorLight::alertRGB(uint8_t r, uint8_t g, uint8_t b) |
| 1181 | 1188 | { |
| 1182 | 1189 | return false; |
| 1183 | 1190 | } |
| 1184 | - std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1191 | + std::this_thread::sleep_for(std::chrono::milliseconds(110)); | |
| 1185 | 1192 | if (!alert()) |
| 1186 | 1193 | { |
| 1187 | 1194 | return false; |
| 1188 | 1195 | } |
| 1189 | - std::this_thread::sleep_for(std::chrono::milliseconds(1300)); | |
| 1196 | + std::this_thread::sleep_for(std::chrono::milliseconds(1500)); | |
| 1190 | 1197 | if (!on) |
| 1191 | 1198 | { |
| 1192 | 1199 | return OffNoRefresh(1); | ... | ... |