Skip to content

Commit

Permalink
Renamed NOTIFIER_CALL_MODE_ to CALL_MODE_
Browse files Browse the repository at this point in the history
  • Loading branch information
Aircoookie committed Jul 9, 2021
1 parent 2c6850f commit a17f83c
Show file tree
Hide file tree
Showing 26 changed files with 129 additions and 128 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fixed presets using wrong call mode (e.g. causing buttons to send UDP under direct change type)
- Increased hue buffer
- Renamed `NOTIFIER_CALL_MODE_` to `CALL_MODE_`

#### Build 2107090

Expand Down
4 changes: 2 additions & 2 deletions usermods/Animated_Staircase/Animated_Staircase.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Animated_Staircase : public Usermod {
// Always mark segments as "transitional", we are animating the staircase
segments->setOption(SEG_OPTION_TRANSITIONAL, 1, 1);
}
colorUpdated(NOTIFIER_CALL_MODE_DIRECT_CHANGE);
colorUpdated(CALL_MODE_DIRECT_CHANGE);
}

/*
Expand Down Expand Up @@ -298,7 +298,7 @@ class Animated_Staircase : public Usermod {
}
segments->setOption(SEG_OPTION_ON, 1, 1);
}
colorUpdated(NOTIFIER_CALL_MODE_DIRECT_CHANGE);
colorUpdated(CALL_MODE_DIRECT_CHANGE);
DEBUG_PRINTLN(F("Animated Staircase disabled."));
}
enabled = enable;
Expand Down
2 changes: 1 addition & 1 deletion usermods/PIR_sensor_switch/PIR_Highlight_Standby
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PIRsensorSwitch : public Usermod {
// PIR sensor pin
const uint8_t PIRsensorPin = 13; // D7 on D1 mini
// notification mode for colorUpdated()
const byte NotifyUpdateMode = NOTIFIER_CALL_MODE_NO_NOTIFY; // NOTIFIER_CALL_MODE_DIRECT_CHANGE
const byte NotifyUpdateMode = CALL_MODE_NO_NOTIFY; // CALL_MODE_DIRECT_CHANGE
// 1 min delay before switch off after the sensor state goes LOW
uint32_t m_switchOffDelay = 60000;
// off timer start time
Expand Down
2 changes: 1 addition & 1 deletion usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PIRsensorSwitch : public Usermod
// PIR sensor pin
int8_t PIRsensorPin = PIR_SENSOR_PIN;
// notification mode for colorUpdated()
const byte NotifyUpdateMode = NOTIFIER_CALL_MODE_NO_NOTIFY; // NOTIFIER_CALL_MODE_DIRECT_CHANGE
const byte NotifyUpdateMode = CALL_MODE_NO_NOTIFY; // CALL_MODE_DIRECT_CHANGE
// delay before switch off after the sensor state goes LOW
uint32_t m_switchOffDelay = 600000; // 10min
// off timer start time
Expand Down
32 changes: 16 additions & 16 deletions usermods/battery_keypad_controller/wled06_usermod.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,46 +54,46 @@ void userLoop()
switch (myKey) {
case '1':
applyPreset(1);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '2':
applyPreset(2);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '3':
applyPreset(3);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '4':
applyPreset(4);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '5':
applyPreset(5);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '6':
applyPreset(6);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case 'A':
applyPreset(7);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case 'B':
applyPreset(8);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;

case '7':
effectCurrent += 1;
if (effectCurrent >= MODE_COUNT) effectCurrent = 0;
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '*':
effectCurrent -= 1;
if (effectCurrent < 0) effectCurrent = (MODE_COUNT-1);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;

case '8':
Expand All @@ -102,15 +102,15 @@ void userLoop()
} else if (effectSpeed < 255) {
effectSpeed += 1;
}
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '0':
if (effectSpeed > 15) {
effectSpeed -= 12;
} else if (effectSpeed > 0) {
effectSpeed -= 1;
}
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;

case '9':
Expand All @@ -119,26 +119,26 @@ void userLoop()
} else if (effectIntensity < 255) {
effectIntensity += 1;
}
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case '#':
if (effectIntensity > 15) {
effectIntensity -= 12;
} else if (effectIntensity > 0) {
effectIntensity -= 1;
}
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;

case 'C':
effectPalette += 1;
if (effectPalette >= 50) effectPalette = 0;
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;
case 'D':
effectPalette -= 1;
if (effectPalette <= 0) effectPalette = 50;
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
break;

}
Expand Down
2 changes: 1 addition & 1 deletion usermods/rotary_encoder_change_effect/wled06_usermod.ino
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void userLoop() {

//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification)
// 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
lastTime = millis();
}
}
8 changes: 4 additions & 4 deletions usermods/stairway_wipe_basic/stairway-wipe-usermod-v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class StairwayWipeUsermod : public Usermod {
if (millis() + strip.timebase > (cycleTime - 25)) { //wipe complete
effectCurrent = FX_MODE_STATIC;
timeStaticStart = millis();
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 2;
}
} else if (wipeState == 2) { //static
Expand All @@ -54,7 +54,7 @@ class StairwayWipeUsermod : public Usermod {
#ifdef STAIRCASE_WIPE_OFF
effectCurrent = FX_MODE_COLOR_WIPE;
strip.timebase = 360 + (255 - effectSpeed)*75 - millis(); //make sure wipe starts fully lit
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 4;
#else
turnOff();
Expand Down Expand Up @@ -100,7 +100,7 @@ class StairwayWipeUsermod : public Usermod {
bool doReverse = (userVar0 == 2);
seg.setOption(1, doReverse);

colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
}

void turnOff()
Expand All @@ -111,7 +111,7 @@ class StairwayWipeUsermod : public Usermod {
transitionDelayTemp = 4000; //fade out slowly
#endif
bri = 0;
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 0;
userVar0 = 0;
previousUserVar0 = 0;
Expand Down
8 changes: 4 additions & 4 deletions usermods/stairway_wipe_basic/wled06_usermod.ino
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void userLoop()
if (millis() + strip.timebase > (cycleTime - 25)) { //wipe complete
effectCurrent = FX_MODE_STATIC;
timeStaticStart = millis();
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 2;
}
} else if (wipeState == 2) { //static
Expand All @@ -59,7 +59,7 @@ void userLoop()
#ifdef STAIRCASE_WIPE_OFF
effectCurrent = FX_MODE_COLOR_WIPE;
strip.timebase = 360 + (255 - effectSpeed)*75 - millis(); //make sure wipe starts fully lit
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 4;
#else
turnOff();
Expand Down Expand Up @@ -93,7 +93,7 @@ void startWipe()
bool doReverse = (userVar0 == 2);
seg.setOption(1, doReverse);

colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
}

void turnOff()
Expand All @@ -104,7 +104,7 @@ void turnOff()
transitionDelayTemp = 4000; //fade out slowly
#endif
bri = 0;
colorUpdated(NOTIFIER_CALL_MODE_NOTIFICATION);
colorUpdated(CALL_MODE_NOTIFICATION);
wipeState = 0;
userVar0 = 0;
previousUserVar0 = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class RotaryEncoderBrightnessColor : public Usermod
}
//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification)
// 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa
colorUpdated(NOTIFIER_CALL_MODE_BUTTON);
updateInterfaces(NOTIFIER_CALL_MODE_BUTTON);
colorUpdated(CALL_MODE_BUTTON);
updateInterfaces(CALL_MODE_BUTTON);
}
Enc_A_prev = Enc_A; // Store value of A for next time
loopTime = currentTime; // Updates loopTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class RotaryEncoderUIUsermod : public Usermod {

//call for notifier -> 0: init 1: direct change 2: button 3: notification 4: nightlight 5: other (No notification)
// 6: fx changed 7: hue 8: preset cycle 9: blynk 10: alexa
colorUpdated(NOTIFIER_CALL_MODE_DIRECT_CHANGE);
updateInterfaces(NOTIFIER_CALL_MODE_DIRECT_CHANGE);
colorUpdated(CALL_MODE_DIRECT_CHANGE);
updateInterfaces(CALL_MODE_DIRECT_CHANGE);
}

void changeBrightness(bool increase) {
Expand Down
4 changes: 2 additions & 2 deletions usermods/word-clock-matrix/word-clock-matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ void hourChime()
{
//strip.resetSegments();
selectWordSegments(true);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
savePreset(13, false);
selectWordSegments(false);
//strip.getSegment(0).setOption(0, true);
strip.getSegment(0).setOption(2, true);
applyPreset(12);
colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED);
colorUpdated(CALL_MODE_FX_CHANGED);
}

void displayTime(byte hour, byte minute)
Expand Down
12 changes: 6 additions & 6 deletions wled00/alexa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ void onAlexaChange(EspalexaDevice* dev)
if (bri == 0)
{
bri = briLast;
colorUpdated(NOTIFIER_CALL_MODE_ALEXA);
colorUpdated(CALL_MODE_ALEXA);
}
} else {
applyPreset(macroAlexaOn, NOTIFIER_CALL_MODE_ALEXA);
applyPreset(macroAlexaOn, CALL_MODE_ALEXA);
if (bri == 0) espalexaDevice->setValue(briLast); //stop Alexa from complaining if macroAlexaOn does not actually turn on
}
} else if (m == EspalexaDeviceProperty::off)
Expand All @@ -58,16 +58,16 @@ void onAlexaChange(EspalexaDevice* dev)
{
briLast = bri;
bri = 0;
colorUpdated(NOTIFIER_CALL_MODE_ALEXA);
colorUpdated(CALL_MODE_ALEXA);
}
} else {
applyPreset(macroAlexaOff, NOTIFIER_CALL_MODE_ALEXA);
applyPreset(macroAlexaOff, CALL_MODE_ALEXA);
if (bri != 0) espalexaDevice->setValue(0); //stop Alexa from complaining if macroAlexaOff does not actually turn off
}
} else if (m == EspalexaDeviceProperty::bri)
{
bri = espalexaDevice->getValue();
colorUpdated(NOTIFIER_CALL_MODE_ALEXA);
colorUpdated(CALL_MODE_ALEXA);
} else //color
{
if (espalexaDevice->getColorMode() == EspalexaColorMode::ct) //shade of white
Expand All @@ -93,7 +93,7 @@ void onAlexaChange(EspalexaDevice* dev)
col[2] = ( color & 0xFF);
col[3] = 0;
}
colorUpdated(NOTIFIER_CALL_MODE_ALEXA);
colorUpdated(CALL_MODE_ALEXA);
}
}

Expand Down
14 changes: 7 additions & 7 deletions wled00/blynk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,45 @@ void updateBlynk()
BLYNK_WRITE(V0)
{
bri = param.asInt();//bri
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V1)
{
blHue = param.asInt();//hue
colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V2)
{
blSat = param.asInt();//sat
colorHStoRGB(blHue*10,blSat,(false)? colSec:col);
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V3)
{
bool on = (param.asInt()>0);
if (!on != !bri) {toggleOnOff(); colorUpdated(NOTIFIER_CALL_MODE_BLYNK);}
if (!on != !bri) {toggleOnOff(); colorUpdated(CALL_MODE_BLYNK);}
}

BLYNK_WRITE(V4)
{
effectCurrent = param.asInt()-1;//fx
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V5)
{
effectSpeed = param.asInt();//sx
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V6)
{
effectIntensity = param.asInt();//ix
colorUpdated(NOTIFIER_CALL_MODE_BLYNK);
colorUpdated(CALL_MODE_BLYNK);
}

BLYNK_WRITE(V7)
Expand Down
Loading

0 comments on commit a17f83c

Please sign in to comment.