Skip to content

Commit

Permalink
scheduler: webui sun module, utc cannot be alone
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed May 16, 2024
1 parent 44c4124 commit 8735f4d
Show file tree
Hide file tree
Showing 22 changed files with 13,155 additions and 13,033 deletions.
Binary file modified code/espurna/data/index.all.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.curtain.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.garland.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.light.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.lightfox.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.rfbridge.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.rfm69.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.sensor.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.small.html.gz
Binary file not shown.
Binary file modified code/espurna/data/index.thermostat.html.gz
Binary file not shown.
9 changes: 9 additions & 0 deletions code/espurna/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ void migrate(int version) {
#if SCHEDULER_SUN_SUPPORT
namespace sun {

STRING_VIEW_INLINE(Module, "sun");

void setup() {
location.latitude = settings::latitude();
location.longitude = settings::longitude();
Expand Down Expand Up @@ -953,6 +955,13 @@ bool onKey(StringView key, const JsonVariant&) {

void onVisible(JsonObject& root) {
wsPayloadModule(root, settings::Prefix);
#if SCHEDULER_SUN_SUPPORT
wsPayloadModule(root, sun::Module);
#endif

for (const auto& pair : settings::Settings) {
root[pair.key()] = pair.value();
}
}

void onConnected(JsonObject& root){
Expand Down
1,969 changes: 988 additions & 981 deletions code/espurna/static/index.all.html.gz.h

Large diffs are not rendered by default.

2,948 changes: 1,478 additions & 1,470 deletions code/espurna/static/index.curtain.html.gz.h

Large diffs are not rendered by default.

2,894 changes: 1,451 additions & 1,443 deletions code/espurna/static/index.garland.html.gz.h

Large diffs are not rendered by default.

555 changes: 281 additions & 274 deletions code/espurna/static/index.light.html.gz.h

Large diffs are not rendered by default.

2,894 changes: 1,451 additions & 1,443 deletions code/espurna/static/index.lightfox.html.gz.h

Large diffs are not rendered by default.

2,954 changes: 1,481 additions & 1,473 deletions code/espurna/static/index.rfbridge.html.gz.h

Large diffs are not rendered by default.

2,970 changes: 1,489 additions & 1,481 deletions code/espurna/static/index.rfm69.html.gz.h

Large diffs are not rendered by default.

3,146 changes: 1,577 additions & 1,569 deletions code/espurna/static/index.sensor.html.gz.h

Large diffs are not rendered by default.

2,865 changes: 1,437 additions & 1,428 deletions code/espurna/static/index.small.html.gz.h

Large diffs are not rendered by default.

2,940 changes: 1,474 additions & 1,466 deletions code/espurna/static/index.thermostat.html.gz.h

Large diffs are not rendered by default.

44 changes: 39 additions & 5 deletions code/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -971,14 +971,48 @@ <h2>Executes actions based on the current time.</h2>
<p>At least one time string element must be specified</p>
<ul>
<li><samp>YEAR-MONTH-DAY</samp> or <samp>MONTH-DAY</samp></li>
<li><samp>Weekday</samp> in English (abbreviated of full). Or, number in range <samp>1&ndash;7</samp>, starting from Monday (1) and ending in Sunday (7)</li>
<li><samp>Weekday</samp> in English (abbreviated of full), or number in range <samp>1&ndash;7</samp> (1 meaning Monday and 7 - Sunday)</li>
<li><samp>HOUR:MINUTE</samp></li>
<li><samp>UTC</samp> either immediately following the time, or instead of it (would default to 00:00)</li>
</ul>

<p><samp>HOUR:MINUTE</samp> always uses local time, unless followed by <samp>UTC</samp></p>

<a href="https://github.com/xoseperez/espurna/wiki/Scheduler">See full documentation</a>

<div class="page">
<fieldset>
<legend>General settings</legend>

<div class="pure-control-group">
<label>Restore days</label>
<input name="schRstrDays" type="number">
<span class="pure-form-message">
Number of days to look back when restoring schedule. Set to zero to only check current day.
</span>
</div>
</fieldset>

<fieldset class="module module-sun">
<legend>Location</legend>

<p>Used for <samp>Sunrise</samp> or <samp>Sunset</samp>, which can be specified instead of <samp>HOUR:MINUTE</samp></p>

<div class="pure-control-group">
<label>Latitude</label>
<input name="schLat" type="text">
</div>

<div class="pure-control-group">
<label>Longitude</label>
<input name="schLong" type="text">
</div>

<div class="pure-control-group">
<label>Altitude</label>
<input name="schAlt" type="text">
</div>
</fieldset>

<fieldset>
<legend>List of schedules</legend>
<div id="schedules" class="settings-group" data-settings-target="schType" data-settings-schema="schType schRestore schTime schAction"></div>
Expand Down Expand Up @@ -2253,9 +2287,9 @@ <h2>
<div class="pure-g">
<div class="pure-control-group pure-u-1 pure-u-lg-1-4">
<select class="pure-input-2-3" name="schType">
<option selected disabled value="unknown"></option>
<option value="disabled">Disabled</option>
<option value="calendar">Calendar</option>
<option selected disabled value="0"></option>
<option value="1">Disabled</option>
<option value="2">Calendar</option>
</select>
</div>

Expand Down

0 comments on commit 8735f4d

Please sign in to comment.