Public Access
Random refresh effect: choose which effects it picks from
The list is a new setting (hardware settings, also used by pages set to Random); an empty list is refused. The ESP32 picks an effect per frame and sends that, so the Nano needs no change. The power-on time after a frame now follows the slowest effect on the list. The settings record goes to version 8. Version 7 is a prefix of it, so it is still read, and becomes version 8 with the next save. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8fcb17c395
commit
48e29096c0
12 files changed
+140
-21
No files matched your search
+9
-3
@@ -93,9 +93,14 @@ static void applyOffPage()
|
||||
static void apply()
|
||||
{
|
||||
controller.setSettings(settings.schedule, settings.clock, settings.slow_mode);
|
||||
controller.setEffectTime(effectTime(settings.drive));
|
||||
status.setDrive(settings.flip_time, settings.drive, settings.refresh.dots);
|
||||
frames.setDrive(settings.flip_time, settings.drive);
|
||||
controller.setEffectTime(effectTime(settings.drive, settings.random_effects));
|
||||
// What the Nano stores and uses until the first frame. Its own Random doesn't know the
|
||||
// list, so it never gets that: the first effect on the list instead.
|
||||
DriveSettings stored_drive = settings.drive;
|
||||
if (stored_drive.effect == DRIVE_EFFECT_RANDOM)
|
||||
stored_drive.effect = pickRandomEffect(settings.random_effects, 0);
|
||||
status.setDrive(settings.flip_time, stored_drive, settings.refresh.dots);
|
||||
frames.setDrive(settings.flip_time, settings.drive, settings.random_effects);
|
||||
char user[PLEX_USER_SIZE];
|
||||
plexUserSlug(settings.plex_user, user, sizeof(user));
|
||||
haApiSetSettings(settings.home_assistant, user);
|
||||
@@ -149,6 +154,7 @@ const char *appSaveSettings(const Settings &new_settings, bool &restart_needed)
|
||||
bool drive_changed = settings.flip_time != new_settings.flip_time || a.flip_gap != b.flip_gap ||
|
||||
a.pulses != b.pulses || a.effect != b.effect || a.effect_time != b.effect_time ||
|
||||
a.effect_small_only != b.effect_small_only ||
|
||||
settings.random_effects != new_settings.random_effects ||
|
||||
settings.refresh.dots != new_settings.refresh.dots;
|
||||
settings = new_settings;
|
||||
saveSettings(settings);
|
||||
|
||||
Reference in new issue
Block a user