Merge remote-tracking branch 'origin/main' into mdev

This commit is contained in:
Ewoud
2022-10-28 11:36:49 +02:00
22 changed files with 2635 additions and 93 deletions

7
.github/FUNDING.yml vendored
View File

@@ -1,5 +1,2 @@
github: [Aircoookie]
custom: ['https://paypal.me/Aircoookie']
github: [blazoncek]
custom: ['https://paypal.me/blazoncek']
github: [Aircoookie,blazoncek]
custom: ['https://paypal.me/Aircoookie','https://paypal.me/blazoncek']

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: WLED Discord community
url: https://discord.gg/KuqP7NE
about: Please ask and answer questions and discuss setup issues here!
- name: WLED community forum
url: https://wled.discourse.group/
about: For issues and ideas that might need longer discussion.
- name: kno.wled.ge base
url: https://kno.wled.ge/basics/faq/
about: Take a look at the frequently asked questions and documentation, perhaps your question is already answered!

View File

@@ -1,19 +0,0 @@
---
name: Question
about: Have a question about using WLED?
title: ''
labels: question
assignees: ''
---
**Take a look at the wiki and FAQ, perhaps your question is already answered!**
[FAQ](https://github.com/Aircoookie/WLED/wiki/FAQ)
**Please consider asking your question on the WLED forum or Discord**
[Forum](https://wled.discourse.group/)
[Discord](https://discord.gg/KuqP7NE)
[What to post where?](https://github.com/Aircoookie/WLED/issues/658)
**If you do not like to use these platforms, delete this template and ask away!**
Please keep in mind though that the issue section is generally not the preferred place for general questions.

View File

@@ -42,7 +42,7 @@ private:
bool getLuminanceComplete = false;
// flag set at startup
bool disabled = false;
bool enabled = true;
// strings to reduce flash memory usage (used more than twice)
static const char _name[];
@@ -133,7 +133,7 @@ public:
void loop()
{
if (disabled || strip.isUpdating())
if ((!enabled) || strip.isUpdating())
return;
unsigned long now = millis();
@@ -205,7 +205,7 @@ public:
{
// we add JSON object.
JsonObject top = root.createNestedObject(FPSTR(_name)); // usermodname
top[FPSTR(_enabled)] = !disabled;
top[FPSTR(_enabled)] = enabled;
top[FPSTR(_maxReadInterval)] = maxReadingInterval;
top[FPSTR(_minReadInterval)] = minReadingInterval;
top[FPSTR(_HomeAssistantDiscovery)] = HomeAssistantDiscovery;
@@ -233,7 +233,7 @@ public:
}
bool configComplete = !top.isNull();
configComplete &= getJsonValue(top[FPSTR(_enabled)], disabled, false);
configComplete &= getJsonValue(top[FPSTR(_enabled)], enabled, false);
configComplete &= getJsonValue(top[FPSTR(_maxReadInterval)], maxReadingInterval, 10000); //ms
configComplete &= getJsonValue(top[FPSTR(_minReadInterval)], minReadingInterval, 500); //ms
configComplete &= getJsonValue(top[FPSTR(_HomeAssistantDiscovery)], HomeAssistantDiscovery, false);

View File

@@ -22,36 +22,20 @@
*
* v2 usermods are class inheritance based and can (but don't have to) implement more functions, each of them is shown in this example.
* Multiple v2 usermods can be added to one compilation easily.
*
* Creating a usermod:
* This file serves as an example. If you want to create a usermod, it is recommended to use usermod_v2_empty.h from the usermods folder as a template.
* Please remember to rename the class and file to a descriptive name.
* You may also use multiple .h and .cpp files.
*
* Using a usermod:
* 1. Copy the usermod into the sketch folder (same folder as wled00.ino)
* 2. Register the usermod by adding #include "usermod_filename.h" in the top and registerUsermod(new MyUsermodClass()) in the bottom of usermods_list.cpp
*/
class PIRsensorSwitch : public Usermod
{
public:
/**
* constructor
*/
// constructor
PIRsensorSwitch() {}
/**
* desctructor
*/
// destructor
~PIRsensorSwitch() {}
/**
* Enable/Disable the PIR sensor
*/
//Enable/Disable the PIR sensor
void EnablePIRsensor(bool en) { enabled = en; }
/**
* Get PIR sensor enabled/disabled state
*/
// Get PIR sensor enabled/disabled state
bool PIRsensorEnabled() { return enabled; }
private:
@@ -78,6 +62,9 @@ private:
bool m_offOnly = false;
bool m_offMode = offMode;
// Home Assistant
bool HomeAssistantDiscovery = false; // is HA discovery turned on
// strings to reduce flash memory usage (used more than twice)
static const char _name[];
static const char _switchOffDelay[];
@@ -87,6 +74,7 @@ private:
static const char _nightTime[];
static const char _mqttOnly[];
static const char _offOnly[];
static const char _haDiscovery[];
static const char _notify[];
/**
@@ -167,7 +155,7 @@ private:
void publishMqtt(const char* state)
{
//Check if MQTT Connected, otherwise it will crash the 8266
if (WLED_MQTT_CONNECTED){
if (WLED_MQTT_CONNECTED) {
char subuf[64];
strcpy(subuf, mqttDeviceTopic);
strcat_P(subuf, PSTR("/motion"));
@@ -175,6 +163,40 @@ private:
}
}
// Create an MQTT Binary Sensor for Home Assistant Discovery purposes, this includes a pointer to the topic that is published to in the Loop.
void publishHomeAssistantAutodiscovery()
{
if (WLED_MQTT_CONNECTED) {
StaticJsonDocument<600> doc;
char uid[24], json_str[1024], buf[128];
sprintf_P(buf, PSTR("%s Motion"), serverDescription); //max length: 33 + 7 = 40
doc[F("name")] = buf;
sprintf_P(buf, PSTR("%s/motion"), mqttDeviceTopic); //max length: 33 + 7 = 40
doc[F("stat_t")] = buf;
doc[F("pl_on")] = "on";
doc[F("pl_off")] = "off";
sprintf_P(uid, PSTR("%s_motion"), escapedMac.c_str());
doc[F("uniq_id")] = uid;
doc[F("dev_cla")] = F("motion");
doc[F("exp_aft")] = 1800;
JsonObject device = doc.createNestedObject(F("device")); // attach the sensor to the same device
device[F("name")] = serverDescription;
device[F("ids")] = String(F("wled-sensor-")) + mqttClientID;
device[F("mf")] = "WLED";
device[F("mdl")] = F("FOSS");
device[F("sw")] = versionString;
sprintf_P(buf, PSTR("homeassistant/binary_sensor/%s/config"), uid);
DEBUG_PRINTLN(buf);
size_t payload_size = serializeJson(doc, json_str);
DEBUG_PRINTLN(json_str);
mqtt->publish(buf, 0, true, json_str, payload_size); // do we really need to retain?
}
}
/**
* Read and update PIR sensor state.
* Initilize/reset switch off timer
@@ -251,6 +273,15 @@ public:
{
}
/**
* onMqttConnect() is called when MQTT connection is established
*/
void onMqttConnect(bool sessionPresent) {
if (HomeAssistantDiscovery) {
publishHomeAssistantAutodiscovery();
}
}
/**
* loop() is called continuously. Here you can check for events, read sensors, etc.
*/
@@ -371,10 +402,17 @@ public:
top[FPSTR(_nightTime)] = m_nightTimeOnly;
top[FPSTR(_mqttOnly)] = m_mqttOnly;
top[FPSTR(_offOnly)] = m_offOnly;
top[FPSTR(_haDiscovery)] = HomeAssistantDiscovery;
top[FPSTR(_notify)] = (NotifyUpdateMode != CALL_MODE_NO_NOTIFY);
DEBUG_PRINTLN(F("PIR config saved."));
}
void appendConfigData()
{
oappend(SET_F("addInfo('PIRsensorSwitch:HA-discovery',1,'HA=Home Assistant');")); // 0 is field type, 1 is actual field
oappend(SET_F("addInfo('PIRsensorSwitch:notifications',1,'Periodic WS updates');")); // 0 is field type, 1 is actual field
}
/**
* restore the changeable values
* readFromConfig() is called before setup() to populate properties from values stored in cfg.json
@@ -407,6 +445,7 @@ public:
m_nightTimeOnly = top[FPSTR(_nightTime)] | m_nightTimeOnly;
m_mqttOnly = top[FPSTR(_mqttOnly)] | m_mqttOnly;
m_offOnly = top[FPSTR(_offOnly)] | m_offOnly;
HomeAssistantDiscovery = top[FPSTR(_haDiscovery)] | HomeAssistantDiscovery;
NotifyUpdateMode = top[FPSTR(_notify)] ? CALL_MODE_DIRECT_CHANGE : CALL_MODE_NO_NOTIFY;
@@ -435,7 +474,7 @@ public:
DEBUG_PRINTLN(F(" config (re)loaded."));
}
// use "return !top["newestParameter"].isNull();" when updating Usermod with new features
return !top[FPSTR(_notify)].isNull();
return !top[FPSTR(_haDiscovery)].isNull();
}
/**
@@ -457,4 +496,5 @@ const char PIRsensorSwitch::_offPreset[] PROGMEM = "off-preset";
const char PIRsensorSwitch::_nightTime[] PROGMEM = "nighttime-only";
const char PIRsensorSwitch::_mqttOnly[] PROGMEM = "mqtt-only";
const char PIRsensorSwitch::_offOnly[] PROGMEM = "off-only";
const char PIRsensorSwitch::_haDiscovery[] PROGMEM = "HA-discovery";
const char PIRsensorSwitch::_notify[] PROGMEM = "notifications";

View File

@@ -4,3 +4,16 @@ By @bwente
See https://www.hackster.io/bwente/word-clock-with-just-two-components-073834 for the hardware guide!
Includes a customizable feature to lower the brightness at night.
![image](https://user-images.githubusercontent.com/371964/197094071-f8ccaf59-1d85-4dd2-8e09-1389675291e1.png)
![image](https://user-images.githubusercontent.com/371964/197094211-6c736257-95ff-491f-9f0d-35d5135ecfea.png)
![mini_8x8_word_clock_reverse_stencil_sZFti6chj4(1)](https://user-images.githubusercontent.com/371964/197094410-7c275f3f-743b-477a-bc15-5e7bdbcbd833.svg)
![mini_8x8_word_clock_box_epUWJOBOhr(1)](https://user-images.githubusercontent.com/371964/197094496-fa49b355-164b-4bf5-84fd-f22f5206c645.svg)

View File

@@ -0,0 +1,338 @@
#pragma once
#include "wled.h"
/*
* Things to do...
* Turn on ntp clock 24h format
* 64 LEDS
*/
class WordClockMatrix : public Usermod
{
private:
unsigned long lastTime = 0;
uint8_t minuteLast = 99;
int dayBrightness = 128;
int nightBrightness = 16;
public:
void setup()
{
Serial.println("Hello from my usermod!");
//saveMacro(14, "A=128", false);
//saveMacro(15, "A=64", false);
//saveMacro(16, "A=16", false);
//saveMacro(1, "&FX=0&R=255&G=255&B=255", false);
//strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true);
//select first two segments (background color + FX settable)
WS2812FX::Segment &seg = strip.getSegment(0);
seg.colors[0] = ((0 << 24) | ((0 & 0xFF) << 16) | ((0 & 0xFF) << 8) | ((0 & 0xFF)));
strip.getSegment(0).setOption(0, false);
strip.getSegment(0).setOption(2, false);
//other segments are text
for (int i = 1; i < 10; i++)
{
WS2812FX::Segment &seg = strip.getSegment(i);
seg.colors[0] = ((0 << 24) | ((0 & 0xFF) << 16) | ((190 & 0xFF) << 8) | ((180 & 0xFF)));
strip.getSegment(i).setOption(0, true);
strip.setBrightness(64);
}
}
void connected()
{
Serial.println("Connected to WiFi!");
}
void selectWordSegments(bool state)
{
for (int i = 1; i < 10; i++)
{
//WS2812FX::Segment &seg = strip.getSegment(i);
strip.getSegment(i).setOption(0, state);
// strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true);
//seg.mode = 12;
//seg.palette = 1;
//strip.setBrightness(255);
}
strip.getSegment(0).setOption(0, !state);
}
void hourChime()
{
//strip.resetSegments();
selectWordSegments(true);
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(CALL_MODE_FX_CHANGED);
}
void displayTime(byte hour, byte minute)
{
bool isToHour = false; //true if minute > 30
strip.setSegment(0, 0, 64); // background
strip.setSegment(1, 0, 2); //It is
strip.setSegment(2, 0, 0);
strip.setSegment(3, 0, 0); //disable minutes
strip.setSegment(4, 0, 0); //past
strip.setSegment(6, 0, 0); //to
strip.setSegment(8, 0, 0); //disable o'clock
if (hour < 24) //valid time, display
{
if (minute == 30)
{
strip.setSegment(2, 3, 6); //half
strip.setSegment(3, 0, 0); //minutes
}
else if (minute == 15 || minute == 45)
{
strip.setSegment(3, 0, 0); //minutes
}
else if (minute == 10)
{
//strip.setSegment(5, 6, 8); //ten
}
else if (minute == 5)
{
//strip.setSegment(5, 16, 18); //five
}
else if (minute == 0)
{
strip.setSegment(3, 0, 0); //minutes
//hourChime();
}
else
{
strip.setSegment(3, 18, 22); //minutes
}
//past or to?
if (minute == 0)
{ //full hour
strip.setSegment(3, 0, 0); //disable minutes
strip.setSegment(4, 0, 0); //disable past
strip.setSegment(6, 0, 0); //disable to
strip.setSegment(8, 60, 64); //o'clock
}
else if (minute > 34)
{
//strip.setSegment(6, 22, 24); //to
//minute = 60 - minute;
isToHour = true;
}
else
{
//strip.setSegment(4, 24, 27); //past
//isToHour = false;
}
}
//byte minuteRem = minute %10;
if (minute <= 4)
{
strip.setSegment(3, 0, 0); //nothing
strip.setSegment(5, 0, 0); //nothing
strip.setSegment(6, 0, 0); //nothing
strip.setSegment(8, 60, 64); //o'clock
}
else if (minute <= 9)
{
strip.setSegment(5, 16, 18); // five past
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 14)
{
strip.setSegment(5, 6, 8); // ten past
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 19)
{
strip.setSegment(5, 8, 12); // quarter past
strip.setSegment(3, 0, 0); //minutes
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 24)
{
strip.setSegment(5, 12, 16); // twenty past
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 29)
{
strip.setSegment(5, 12, 18); // twenty-five past
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 34)
{
strip.setSegment(5, 3, 6); // half past
strip.setSegment(3, 0, 0); //minutes
strip.setSegment(4, 24, 27); //past
}
else if (minute <= 39)
{
strip.setSegment(5, 12, 18); // twenty-five to
strip.setSegment(6, 22, 24); //to
}
else if (minute <= 44)
{
strip.setSegment(5, 12, 16); // twenty to
strip.setSegment(6, 22, 24); //to
}
else if (minute <= 49)
{
strip.setSegment(5, 8, 12); // quarter to
strip.setSegment(3, 0, 0); //minutes
strip.setSegment(6, 22, 24); //to
}
else if (minute <= 54)
{
strip.setSegment(5, 6, 8); // ten to
strip.setSegment(6, 22, 24); //to
}
else if (minute <= 59)
{
strip.setSegment(5, 16, 18); // five to
strip.setSegment(6, 22, 24); //to
}
//hours
if (hour > 23)
return;
if (isToHour)
hour++;
if (hour > 12)
hour -= 12;
if (hour == 0)
hour = 12;
switch (hour)
{
case 1:
strip.setSegment(7, 27, 29);
break; //one
case 2:
strip.setSegment(7, 35, 37);
break; //two
case 3:
strip.setSegment(7, 29, 32);
break; //three
case 4:
strip.setSegment(7, 32, 35);
break; //four
case 5:
strip.setSegment(7, 37, 40);
break; //five
case 6:
strip.setSegment(7, 43, 45);
break; //six
case 7:
strip.setSegment(7, 40, 43);
break; //seven
case 8:
strip.setSegment(7, 45, 48);
break; //eight
case 9:
strip.setSegment(7, 48, 50);
break; //nine
case 10:
strip.setSegment(7, 54, 56);
break; //ten
case 11:
strip.setSegment(7, 50, 54);
break; //eleven
case 12:
strip.setSegment(7, 56, 60);
break; //twelve
}
selectWordSegments(true);
applyMacro(1);
}
void timeOfDay()
{
// NOT USED: use timed macros instead
//Used to set brightness dependant of time of day - lights dimmed at night
//monday to thursday and sunday
if ((weekday(localTime) == 6) | (weekday(localTime) == 7))
{
if ((hour(localTime) > 0) | (hour(localTime) < 8))
{
strip.setBrightness(nightBrightness);
}
else
{
strip.setBrightness(dayBrightness);
}
}
else
{
if ((hour(localTime) < 6) | (hour(localTime) >= 22))
{
strip.setBrightness(nightBrightness);
}
else
{
strip.setBrightness(dayBrightness);
}
}
}
//loop. You can use "if (WLED_CONNECTED)" to check for successful connection
void loop()
{
if (millis() - lastTime > 1000) {
//Serial.println("I'm alive!");
Serial.println(hour(localTime));
lastTime = millis();
}
if (minute(localTime) != minuteLast)
{
updateLocalTime();
//timeOfDay();
minuteLast = minute(localTime);
displayTime(hour(localTime), minute(localTime));
if (minute(localTime) == 0)
{
hourChime();
}
if (minute(localTime) == 1)
{
//turn off background segment;
strip.getSegment(0).setOption(2, false);
//applyPreset(13);
}
}
}
void addToConfig(JsonObject& root)
{
JsonObject modName = root.createNestedObject("id");
modName["mdns"] = "wled-word-clock";
modName["name"] = "WLED WORD CLOCK";
}
uint16_t getId()
{
return USERMOD_ID_WORD_CLOCK_MATRIX;
}
};

View File

@@ -14,17 +14,25 @@ void onAlexaChange(EspalexaDevice* dev);
void alexaInit()
{
if (alexaEnabled && WLED_CONNECTED)
{
if (espalexaDevice == nullptr) //only init once
if (!alexaEnabled || !WLED_CONNECTED) return;
espalexa.removeAllDevices();
// the original configured device for on/off or macros (added first, i.e. index 0)
espalexaDevice = new EspalexaDevice(alexaInvocationName, onAlexaChange, EspalexaDeviceType::extendedcolor);
espalexa.addDevice(espalexaDevice);
// up to 9 devices (added second, third, ... i.e. index 1 to 9) serve for switching on up to nine presets (preset IDs 1 to 9 in WLED),
// names are identical as the preset names, switching off can be done by switching off any of them
if (alexaNumPresets) {
String name = "";
for (byte presetIndex = 1; presetIndex <= alexaNumPresets; presetIndex++)
{
espalexaDevice = new EspalexaDevice(alexaInvocationName, onAlexaChange, EspalexaDeviceType::extendedcolor);
espalexa.addDevice(espalexaDevice);
espalexa.begin(&server);
} else {
espalexaDevice->setName(alexaInvocationName);
if (!getPresetName(presetIndex, name)) break; // no more presets
EspalexaDevice* dev = new EspalexaDevice(name.c_str(), onAlexaChange, EspalexaDeviceType::extendedcolor);
espalexa.addDevice(dev);
}
}
espalexa.begin(&server);
}
void handleAlexa()
@@ -35,20 +43,34 @@ void handleAlexa()
void onAlexaChange(EspalexaDevice* dev)
{
EspalexaDeviceProperty m = espalexaDevice->getLastChangedProperty();
EspalexaDeviceProperty m = dev->getLastChangedProperty();
if (m == EspalexaDeviceProperty::on)
{
if (!macroAlexaOn)
if (dev->getId() == 0) // Device 0 is for on/off or macros
{
if (bri == 0)
if (!macroAlexaOn)
{
bri = briLast;
stateUpdated(CALL_MODE_ALEXA);
if (bri == 0)
{
bri = briLast;
stateUpdated(CALL_MODE_ALEXA);
}
} else
{
applyPreset(macroAlexaOn, CALL_MODE_ALEXA);
if (bri == 0) dev->setValue(briLast); //stop Alexa from complaining if macroAlexaOn does not actually turn on
}
} else {
applyPreset(macroAlexaOn, CALL_MODE_ALEXA);
if (bri == 0) espalexaDevice->setValue(briLast); //stop Alexa from complaining if macroAlexaOn does not actually turn on
} else // switch-on behavior for preset devices
{
// turn off other preset devices
for (byte i = 1; i < espalexa.getDeviceCount(); i++)
{
if (i == dev->getId()) continue;
espalexa.getDevice(i)->setValue(0); // turn off other presets
}
applyPreset(dev->getId(), CALL_MODE_ALEXA); // in alexaInit() preset 1 device was added second (index 1), preset 2 third (index 2) etc.
}
} else if (m == EspalexaDeviceProperty::off)
{
@@ -60,20 +82,25 @@ void onAlexaChange(EspalexaDevice* dev)
bri = 0;
stateUpdated(CALL_MODE_ALEXA);
}
} else {
} else
{
applyPreset(macroAlexaOff, CALL_MODE_ALEXA);
if (bri != 0) espalexaDevice->setValue(0); //stop Alexa from complaining if macroAlexaOff does not actually turn off
// below for loop stops Alexa from complaining if macroAlexaOff does not actually turn off
}
for (byte i = 0; i < espalexa.getDeviceCount(); i++)
{
espalexa.getDevice(i)->setValue(0);
}
} else if (m == EspalexaDeviceProperty::bri)
{
bri = espalexaDevice->getValue();
bri = dev->getValue();
stateUpdated(CALL_MODE_ALEXA);
} else //color
{
if (espalexaDevice->getColorMode() == EspalexaColorMode::ct) //shade of white
if (dev->getColorMode() == EspalexaColorMode::ct) //shade of white
{
byte rgbw[4];
uint16_t ct = espalexaDevice->getCt();
uint16_t ct = dev->getCt();
if (!ct) return;
uint16_t k = 1000000 / ct; //mireds to kelvin
@@ -94,7 +121,7 @@ void onAlexaChange(EspalexaDevice* dev)
}
strip.setColor(0, RGBW32(rgbw[0], rgbw[1], rgbw[2], rgbw[3]));
} else {
uint32_t color = espalexaDevice->getRGB();
uint32_t color = dev->getRGB();
strip.setColor(0, color);
}
stateUpdated(CALL_MODE_ALEXA);

View File

@@ -392,6 +392,8 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
CJSON(macroAlexaOn, interfaces["va"]["macros"][0]);
CJSON(macroAlexaOff, interfaces["va"]["macros"][1]);
CJSON(alexaNumPresets, interfaces["va"]["p"]);
#ifndef WLED_DISABLE_BLYNK
const char* apikey = interfaces["blynk"][F("token")] | "Hidden";
tdd = strnlen(apikey, 36);
@@ -555,11 +557,21 @@ void deserializeConfigFromFS() {
DEBUG_PRINTLN(F("Reading settings from /cfg.json..."));
success = readObjectFromFile("/cfg.json", nullptr, &doc);
if (!success) { //if file does not exist, try reading from EEPROM
if (!success) { // if file does not exist, optionally try reading from EEPROM and then save defaults to FS
releaseJSONBufferLock();
#ifdef WLED_ADD_EEPROM_SUPPORT
deEEPSettings();
#endif
releaseJSONBufferLock();
// save default values to /cfg.json
// call readFromConfig() with an empty object so that usermods can initialize to defaults prior to saving
JsonObject empty = JsonObject();
usermods.readFromConfig(empty);
serializeConfig();
// init Ethernet (in case default type is set at compile time)
#ifdef WLED_USE_ETHERNET
WLED::instance().initEthernet();
#endif
return;
}
@@ -568,7 +580,7 @@ void deserializeConfigFromFS() {
bool needsSave = deserializeConfig(doc.as<JsonObject>(), true);
releaseJSONBufferLock();
if (needsSave) serializeConfig(); // usermods required new prameters
if (needsSave) serializeConfig(); // usermods required new parameters
}
void serializeConfig() {
@@ -839,6 +851,8 @@ void serializeConfig() {
if_va_macros.add(macroAlexaOn);
if_va_macros.add(macroAlexaOff);
if_va["p"] = alexaNumPresets;
#ifndef WLED_DISABLE_BLYNK
JsonObject if_blynk = interfaces.createNestedObject("blynk");
if_blynk[F("token")] = strlen(blynkApiKey) ? "Hidden":"";

View File

@@ -101,7 +101,7 @@ button {
position: fixed;
bottom: calc(var(--bh) + 6px);
right: 6px;
color: var(--c-d); /* should remain bright (--c-d) with dark shadow (see below) to be legible on gray background */
color: var(--c-8); /* set bright (--c-d) with dark text shadow (see below) to be legible on gray background (in image) */
cursor: pointer;
writing-mode: vertical-rl;
/* transform: rotate(180deg); */
@@ -1046,7 +1046,7 @@ textarea {
}
.qcs, #namelabel { /* text shadow for name to be legible on grey backround */
text-shadow: -1px -1px 0 var(--c-4), 1px -1px 0 var(--c-4), -1px 1px 0 var(--c-4), 1px 1px 0 var(--c-4);
text-shadow: -1px -1px 0 var(--c-1), 1px -1px 0 var(--c-1), -1px 1px 0 var(--c-1), 1px 1px 0 var(--c-1);
}
.psts {

View File

@@ -182,6 +182,7 @@ function loadBg(iUrl)
bg.style.opacity = a;
bg.style.backgroundImage = `url(${img.src})`;
img = null;
gId('namelabel').style.color = "var(--c-c)"; // improve namelabel legibility on background image
});
}
@@ -1519,7 +1520,8 @@ function requestJson(command=null)
if (tn != tr) command.transition = tn;
}
req = JSON.stringify(command);
if (req.length > 1430) useWs = false; // do not send very long requests over websocket
if (req.length > 1340) useWs = false; // do not send very long requests over websocket
if (req.length > 500 && lastinfo && lastinfo.arch == "esp8266") useWs = false; // esp8266 can only handle 500 bytes
};
if (useWs) {

View File

@@ -165,7 +165,8 @@ Disable realtime gamma correction: <input type="checkbox" name="RG"><br>
Realtime LED offset: <input name="WO" type="number" min="-255" max="255" required>
<h3>Alexa Voice Assistant</h3>
Emulate Alexa device: <input type="checkbox" name="AL"><br>
Alexa invocation name: <input type="text" name="AI" maxlength="32">
Alexa invocation name: <input type="text" name="AI" maxlength="32"><br>
Also emulate devices to call the first <input name="AP" type="number" class="s" min="0" max="9" required> presets
<h3>Blynk</h3>
<b>Blynk, MQTT and Hue sync all connect to external hosts!<br>
This may impact the responsiveness of the ESP8266.</b><br>

View File

@@ -201,6 +201,7 @@ inline bool applyTemporaryPreset() {return applyPreset(255);};
void savePreset(byte index, const char* pname = nullptr, JsonObject saveobj = JsonObject());
inline void saveTemporaryPreset() {savePreset(255);};
void deletePreset(byte index);
bool getPresetName(byte index, String& name);
//set.cpp
bool isAsterisksOnly(const char* str, byte maxLen);

View File

@@ -1028,8 +1028,9 @@ const uint8_t PAGE_settings_ui[] PROGMEM = {
// Autogenerated from wled00/data/settings_sync.htm, do not edit!!
const uint16_t PAGE_settings_sync_length = 3153;
const uint16_t PAGE_settings_sync_length = 3184;
const uint8_t PAGE_settings_sync[] PROGMEM = {
<<<<<<< HEAD
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x9d, 0x5a, 0xeb, 0x77, 0xda, 0xb8,
0x12, 0xff, 0xee, 0xbf, 0x42, 0xf1, 0x87, 0x5d, 0xd8, 0x38, 0x60, 0x20, 0xa4, 0x29, 0xc1, 0xee,
0x0d, 0x21, 0x4d, 0xd8, 0x6d, 0x1a, 0x0a, 0xe9, 0x3e, 0xce, 0xb9, 0xe7, 0xec, 0x11, 0xb6, 0x00,
@@ -1228,6 +1229,207 @@ const uint8_t PAGE_settings_sync[] PROGMEM = {
0xee, 0xfe, 0x24, 0xf6, 0x23, 0x5f, 0xb7, 0xb4, 0xa5, 0x2f, 0x67, 0xf8, 0x05, 0x0f, 0xfe, 0xe0,
0x57, 0x3e, 0xfc, 0xe4, 0x87, 0xff, 0xa7, 0xe5, 0x7f, 0x3e, 0xc3, 0x8a, 0xee, 0xe3, 0x22, 0x00,
0x00
=======
0x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, 0x38, 0x2a, 0x7b, 0x64, 0x77, 0x4a, 0xd8, 0x5d, 0xef,
0xfe, 0x10, 0xf7, 0x23, 0xdf, 0xd4, 0x8c, 0xa5, 0xef, 0x75, 0xf8, 0xdd, 0x10, 0xfe, 0xe0, 0xb7,
0x45, 0xfc, 0xd0, 0x88, 0xff, 0x93, 0xe6, 0x7f, 0x4b, 0x86, 0xa3, 0xf7, 0x59, 0x23, 0x00, 0x00
>>>>>>> main
};

File diff suppressed because it is too large Load Diff

View File

@@ -75,6 +75,22 @@ static void doSaveState() {
playlistSave = false;
}
bool getPresetName(byte index, String& name)
{
if (!requestJSONBufferLock(9)) return false;
bool presetExists = false;
if (readObjectFromFileUsingId("/presets.json", index, &doc))
{
JsonObject fdo = doc.as<JsonObject>();
if (fdo["n"]) {
name = (const char*)(fdo["n"]);
presetExists = true;
}
}
releaseJSONBufferLock();
return presetExists;
}
bool applyPreset(byte index, byte callMode)
{
DEBUG_PRINT(F("Request to apply preset: "));

View File

@@ -277,6 +277,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
alexaEnabled = request->hasArg(F("AL"));
strlcpy(alexaInvocationName, request->arg(F("AI")).c_str(), 33);
t = request->arg(F("AP")).toInt();
if (t >= 0 && t <= 9) alexaNumPresets = t;
#ifndef WLED_DISABLE_BLYNK
strlcpy(blynkHost, request->arg("BH").c_str(), 33);
@@ -503,7 +505,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
} else {
// there is no Wire.end()
DEBUG_PRINTLN(F("Could not allocate I2C pins."));
uint8_t i2c[2] = { i2c_scl, i2c_sda };
uint8_t i2c[2] = { static_cast<uint8_t>(i2c_scl), static_cast<uint8_t>(i2c_sda) };
pinManager.deallocateMultiplePins(i2c, 2, PinOwner::HW_I2C); // just in case deallocation of old pins
i2c_sda = -1;
i2c_scl = -1;
@@ -532,7 +534,7 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
} else {
//SPI.end();
DEBUG_PRINTLN(F("Could not allocate SPI pins."));
uint8_t spi[3] = { spi_mosi, spi_miso, spi_sclk };
uint8_t spi[3] = { static_cast<uint8_t>(spi_mosi), static_cast<uint8_t>(spi_miso), static_cast<uint8_t>(spi_sclk) };
pinManager.deallocateMultiplePins(spi, 3, PinOwner::HW_SPI); // just in case deallocation of old pins
spi_mosi = -1;
spi_miso = -1;

View File

@@ -359,6 +359,11 @@ public:
return false;
}
// get device count, function only in WLED version of Espalexa
uint8_t getDeviceCount() {
return currentDeviceCount;
}
//service loop
void loop() {
#ifndef ESPALEXA_ASYNC
@@ -393,6 +398,13 @@ public:
}
}
// Function only in WLED version of Espalexa, does not actually release memory for names
void removeAllDevices()
{
currentDeviceCount=0;
return;
}
// returns device index or 0 on failure
uint8_t addDevice(EspalexaDevice* d)
{

View File

@@ -113,7 +113,7 @@
#ifndef WLED_DISABLE_ALEXA
#define ESPALEXA_ASYNC
#define ESPALEXA_NO_SUBPAGE
#define ESPALEXA_MAXDEVICES 1
#define ESPALEXA_MAXDEVICES 10
// #define ESPALEXA_DEBUG
#include "src/dependencies/espalexa/Espalexa.h"
#endif
@@ -358,6 +358,7 @@ WLED_GLOBAL uint8_t udpNumRetries _INIT(0); // Number of t
WLED_GLOBAL bool alexaEnabled _INIT(false); // enable device discovery by Amazon Echo
WLED_GLOBAL char alexaInvocationName[33] _INIT("Light"); // speech control name of device. Choose something voice-to-text can understand
WLED_GLOBAL byte alexaNumPresets _INIT(0); // number of presets to expose to Alexa, starting from preset 1, up to 9
#ifndef WLED_DISABLE_BLYNK
WLED_GLOBAL char blynkApiKey[36] _INIT(""); // Auth token for Blynk server. If empty, no connection will be made

View File

@@ -467,11 +467,5 @@ void deEEPSettings() {
EEPROM.begin(EEPSIZE);
loadSettingsFromEEPROM();
EEPROM.end();
//call readFromConfig() with an empty object so that usermods can initialize to defaults prior to saving
JsonObject empty = JsonObject();
usermods.readFromConfig(empty);
serializeConfig();
}
#endif

View File

@@ -39,11 +39,11 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
if (!index) {
String finalname = filename;
if (finalname.charAt(0) != '/') {
finalname = "/" + finalname; // prepend slash if missing
finalname = '/' + finalname; // prepend slash if missing
}
request->_tempFile = WLED_FS.open(finalname, "w");
DEBUG_PRINT("Uploading ");
DEBUG_PRINT(F("Uploading "));
DEBUG_PRINTLN(finalname);
if (finalname.equals("/presets.json")) presetsModifiedTime = toki.second(); // WLEDSR
}
@@ -622,4 +622,4 @@ void serveSettings(AsyncWebServerRequest* request, bool post)
response->addHeader(FPSTR(s_content_enc),"gzip");
setStaticContentCacheHeaders(response);
request->send(response);
}
}

View File

@@ -509,6 +509,7 @@ void getSettingsJS(byte subPage, char* dest)
sappend('c',SET_F("AL"),alexaEnabled);
sappends('s',SET_F("AI"),alexaInvocationName);
sappend('c',SET_F("SA"),notifyAlexa);
sappend('v',SET_F("AP"),alexaNumPresets);
sappends('s',SET_F("BK"),(char*)((blynkEnabled)?SET_F("Hidden"):""));
#ifndef WLED_DISABLE_BLYNK
sappends('s',SET_F("BH"),blynkHost);