Public Access
Add HA dropdowns, off image, flip fixes and refresh effects
Home Assistant: remove the Clock switch (its entity is deleted on connect), add an IP sensor and Mode / Off image dropdowns whose options follow the saved bitmaps. Remove the built-in "Nintendo border" bitmap. Off image: a bitmap (or blank) left on the dots when the display switches off. Nano: pause after each flip pulse and repeat pulses for changed dots, both stored in EEPROM (G/N commands). Refresh effects (E command): instant, sparkle, wipe, rain, from the middle out, diagonal, spiral, flip all then reveal, push and random, optionally only for small changes. Effects run in steps from loop() so serial input keeps flowing. Web UI: flip settings, refresh effect and test patterns under Settings; the System tab shows why the ESP32 last restarted. Settings records from versions 1 and 2 are migrated. Firmware 2.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a5f6a8b5d
commit
1d3b084de1
42 files changed
+1631
-230
No files matched your search
@@ -15,6 +15,8 @@ const char *validateSettings(const Settings &s)
|
||||
if (!terminated(s.page, sizeof(s.page)) ||
|
||||
(strcmp(s.page, PAGE_CLOCK) != 0 && !validBitmapName(s.page)))
|
||||
return "Unknown page";
|
||||
if (!terminated(s.off_page, sizeof(s.off_page)) || (s.off_page[0] && !validBitmapName(s.off_page)))
|
||||
return "Unknown off image";
|
||||
|
||||
const ScheduleSettings &t = s.schedule;
|
||||
if (t.day_start >= MINUTES_PER_DAY || t.late_start > MINUTES_PER_DAY || t.night_start > MINUTES_PER_DAY)
|
||||
@@ -28,6 +30,16 @@ const char *validateSettings(const Settings &s)
|
||||
if (s.flip_time < SETTINGS_FLIP_TIME_MIN || s.flip_time > SETTINGS_FLIP_TIME_MAX)
|
||||
return "The flip time must be between 50 and 2000 us";
|
||||
|
||||
const DriveSettings &d = s.drive;
|
||||
if (d.flip_gap > 5000)
|
||||
return "The flip gap must be between 0 and 5000 us";
|
||||
if (d.pulses < 1 || d.pulses > 3)
|
||||
return "Pulses must be 1, 2 or 3";
|
||||
if (d.effect >= DRIVE_EFFECT_COUNT)
|
||||
return "Unknown refresh effect";
|
||||
if (d.effect_time < 100 || d.effect_time > 10000)
|
||||
return "The effect time must be between 100 and 10000 ms";
|
||||
|
||||
const HomeAssistantSettings &ha = s.home_assistant;
|
||||
if (!terminated(ha.host, sizeof(ha.host)) || !terminated(ha.user, sizeof(ha.user)) ||
|
||||
!terminated(ha.password, sizeof(ha.password)))
|
||||
@@ -38,6 +50,15 @@ const char *validateSettings(const Settings &s)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t effectTime(const DriveSettings &drive)
|
||||
{
|
||||
if (drive.effect == DRIVE_EFFECT_INSTANT)
|
||||
return 0;
|
||||
if (drive.effect == DRIVE_EFFECT_PUSH || drive.effect == DRIVE_EFFECT_RANDOM)
|
||||
return drive.effect_time + DRIVE_PUSH_EXTRA_TIME;
|
||||
return drive.effect_time;
|
||||
}
|
||||
|
||||
bool parseTime(const char *text, uint16_t &minutes)
|
||||
{
|
||||
if (text == nullptr)
|
||||
|
||||
Reference in new issue
Block a user