diff --git a/doc/screenshot-dark.webp b/doc/screenshot-dark.webp
index f003bb7..ed7ae3c 100644
Binary files a/doc/screenshot-dark.webp and b/doc/screenshot-dark.webp differ
diff --git a/doc/screenshot-light.webp b/doc/screenshot-light.webp
index cf87152..4309e88 100644
Binary files a/doc/screenshot-light.webp and b/doc/screenshot-light.webp differ
diff --git a/src/lib/components/settings/ExtraFeaturesSettings.svelte b/src/lib/components/settings/ExtraFeaturesSettings.svelte
index 2d6615c..bea0033 100644
--- a/src/lib/components/settings/ExtraFeaturesSettings.svelte
+++ b/src/lib/components/settings/ExtraFeaturesSettings.svelte
@@ -69,6 +69,64 @@
bind:isOpen
defaultOpen={false}
>
+
+
+ {#if $settings.dnd.timeBasedEnabled}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/if}
+
{#if 'bitaxeEnabled' in $settings}
diff --git a/src/lib/locales/de.json b/src/lib/locales/de.json
index d1ee257..2044e49 100644
--- a/src/lib/locales/de.json
+++ b/src/lib/locales/de.json
@@ -68,7 +68,12 @@
"nostr": "Nostr-Verlag",
"custom": "Benutzerdefinierter dataquelle"
},
- "fontName": "Schriftart"
+ "fontName": "Schriftart",
+ "timeBasedDnd": "Aktivieren Sie den Zeitplan „Bitte nicht stören“.",
+ "dndStartHour": "Startstunde",
+ "dndStartMinute": "Startminute",
+ "dndEndHour": "Endstunde",
+ "dndEndMinute": "Schlussminute"
},
"control": {
"systemInfo": "Systeminfo",
@@ -96,7 +101,9 @@
"wifiSignalStrength": "WiFi-Signalstärke",
"wsDataConnection": "BTClock-Datenquelle verbindung",
"lightSensor": "Lichtsensor",
- "nostrConnection": "Nostr Relay-Verbindung"
+ "nostrConnection": "Nostr Relay-Verbindung",
+ "doNotDisturb": "Bitte nicht stören",
+ "timeBasedDnd": "Zeitbasierter Zeitplan"
},
"firmwareUpdater": {
"fileUploadSuccess": "Datei erfolgreich hochgeladen, Gerät neu gestartet. WebUI in {countdown} Sekunden neu geladen",
diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json
index 85579e7..302de09 100644
--- a/src/lib/locales/en.json
+++ b/src/lib/locales/en.json
@@ -85,7 +85,12 @@
"thirdPartySource": "Use mempool.space/coincap.io",
"ceDisableSSL": "Disable SSL",
"ceEndpoint": "Endpoint hostname",
- "fontName": "Font"
+ "fontName": "Font",
+ "timeBasedDnd": "Enable Do Not Disturb time schedule",
+ "dndStartHour": "Start hour",
+ "dndStartMinute": "Start minute",
+ "dndEndHour": "End hour",
+ "dndEndMinute": "End minute"
},
"control": {
"systemInfo": "System info",
@@ -115,7 +120,9 @@
"wifiSignalStrength": "WiFi Signal strength",
"wsDataConnection": "BTClock data-source connection",
"lightSensor": "Light sensor",
- "nostrConnection": "Nostr Relay connection"
+ "nostrConnection": "Nostr Relay connection",
+ "doNotDisturb": "Do not disturb",
+ "timeBasedDnd": "Time-based schedule"
},
"firmwareUpdater": {
"fileUploadFailed": "File upload failed. Make sure you have selected the correct file and try again.",
diff --git a/src/lib/locales/es.json b/src/lib/locales/es.json
index a4eba79..4033cab 100644
--- a/src/lib/locales/es.json
+++ b/src/lib/locales/es.json
@@ -67,7 +67,12 @@
"nostr": "editorial nostr",
"custom": "Punto final personalizado"
},
- "fontName": "Fuente"
+ "fontName": "Fuente",
+ "timeBasedDnd": "Habilitar el horario de No molestar",
+ "dndStartHour": "Hora de inicio",
+ "dndStartMinute": "Minuto de inicio",
+ "dndEndHour": "Hora final",
+ "dndEndMinute": "Minuto final"
},
"control": {
"turnOff": "Apagar",
@@ -95,7 +100,9 @@
"wifiSignalStrength": "Fuerza de la señal WiFi",
"wsDataConnection": "Conexión de fuente de datos BTClock",
"lightSensor": "Sensor de luz",
- "nostrConnection": "Conexión de relé Nostr"
+ "nostrConnection": "Conexión de relé Nostr",
+ "doNotDisturb": "No molestar",
+ "timeBasedDnd": "Horario basado en el tiempo"
},
"firmwareUpdater": {
"fileUploadSuccess": "Archivo cargado exitosamente, reiniciando el dispositivo. Recargando WebUI en {countdown} segundos",
diff --git a/src/lib/locales/nl.json b/src/lib/locales/nl.json
index a6dc486..b239905 100644
--- a/src/lib/locales/nl.json
+++ b/src/lib/locales/nl.json
@@ -59,7 +59,12 @@
"flOffWhenDark": "Displaylicht uit als het donker is",
"luxLightToggleText": "Stel in op 0 om uit te schakelen",
"verticalDesc": "Verticale schermbeschrijving",
- "fontName": "Lettertype"
+ "fontName": "Lettertype",
+ "timeBasedDnd": "Schakel het tijdschema Niet storen in",
+ "dndStartHour": "Begin uur",
+ "dndStartMinute": "Beginminuut",
+ "dndEndHour": "Eind uur",
+ "dndEndMinute": "Einde minuut"
},
"control": {
"systemInfo": "Systeeminformatie",
@@ -86,7 +91,9 @@
"wifiSignalStrength": "WiFi signaalsterkte",
"wsDataConnection": "BTClock-gegevensbron verbinding",
"lightSensor": "Licht sensor",
- "nostrConnection": "Nostr Relay-verbinding"
+ "nostrConnection": "Nostr Relay-verbinding",
+ "doNotDisturb": "Niet storen",
+ "timeBasedDnd": "Op tijd gebaseerd schema"
},
"firmwareUpdater": {
"fileUploadSuccess": "Bestand geüpload, apparaat herstart. WebUI opnieuw geladen over {countdown} seconden",
diff --git a/src/routes/Status.svelte b/src/routes/Status.svelte
index e889a0b..a659af0 100644
--- a/src/routes/Status.svelte
+++ b/src/routes/Status.svelte
@@ -97,6 +97,16 @@
}
};
+ const toggleDoNotDisturb = (currentStatus: boolean) => (e: Event) => {
+ e.preventDefault();
+ console.log(currentStatus);
+ if (!currentStatus) {
+ fetch(`${PUBLIC_BASE_URL}/api/dnd/enable`);
+ } else {
+ fetch(`${PUBLIC_BASE_URL}/api/dnd/disable`);
+ }
+ };
+
export let xs = 12;
export let sm = xs;
export let md = sm;
@@ -185,7 +195,27 @@
>{#if $status.timerRunning}⏵ {$_('timer.running')}{:else}⏸ {$_(
'timer.stopped'
)}{/if}
+
+ {$_('section.status.doNotDisturb')}:
+
+ {#if $status.dnd?.active}⏵ {$_('on')}{:else}⏸ {$_('off')}{/if}
+
+ {#if $status.dnd?.timeBasedEnabled}
+ {$_('section.status.timeBasedDnd')} ( {$settings.dnd
+ .startHour}:{$settings.dnd.startMinute.toString().padStart(2, '0')} - {$settings
+ .dnd.endHour}:{$settings.dnd.endMinute.toString().padStart(2, '0')} )
+ {/if}
+
{/if}
{/if}
diff --git a/tests/shared.ts b/tests/shared.ts
index 821f202..ec2bb2d 100644
--- a/tests/shared.ts
+++ b/tests/shared.ts
@@ -22,7 +22,14 @@ export const statusJson = {
{ red: 0, green: 0, blue: 0, hex: '#000000' }
],
isUpdating: true,
- isFake: true
+ isFake: true,
+ dnd: {
+ enabled: true,
+ timeBasedEnabled: true,
+ startTime: '23:00',
+ endTime: '7:00',
+ active: true
+ }
};
export const settingsJson = {
@@ -108,6 +115,14 @@ export const settingsJson = {
'ckpool',
'eu_ckpool'
],
+ dnd: {
+ enabled: false,
+ timeBasedEnabled: true,
+ startHour: 23,
+ startMinute: 0,
+ endHour: 7,
+ endMinute: 0
+ },
availableFonts: ['antonio', 'oswald'],
invertedColor: false,
isLoaded: true,
diff --git a/yarn.lock b/yarn.lock
index 185197e..3224779 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -334,24 +334,7 @@
levn "^0.4.1"
"@fontsource/antonio@^5.1.0":
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/@fontsource/antonio/-/antonio-5.1.0.tgz#e3159a104d364629852ffc5170764f619a8c5754"
- integrity sha512-5FHPDnNXhLg/ccgTSOzqL0v8TqUIYw+HXYXVKsA97dYXm+SpkypXW/R/bTe8eNHVarnNRfYkhYyZq6dKA9/vGQ==
-
-"@fontsource/oswald@^5.1.0":
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/@fontsource/oswald/-/oswald-5.1.0.tgz#00fdbe5ab911bfb261ec26e565eb51d02cb95095"
- integrity sha512-MwHMRCNCeTvaUWk15AHVfUi84T4TB4dshJrCOcfBYqUkY0V8IxKEwqFzSgGBG7zIfTZ0Diu+/CKpiktKqo5Gkg==
-
-"@fontsource/ubuntu@^5.1.0":
- version "5.1.0"
- resolved "https://registry.yarnpkg.com/@fontsource/ubuntu/-/ubuntu-5.1.0.tgz#aad73a6540659e1005e181029cb3f5efd06a438f"
- integrity sha512-0XG/HrFsfP1q3phf4QN8IO7tetd0zOZKHZSHcTnBuVoQedoo1wS/hXxY2FMZuqoG+mVfrXh+Q614MDVmQPJq2w==
-
-"@formatjs/ecma402-abstract@2.2.0":
- version "2.2.0"
- resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.0.tgz#36f5bc0dac4ca77ca429fe44bd95b32d5ccd98dd"
- integrity sha512-IpM+ev1E4QLtstniOE29W1rqH9eTdx5hQdNL8pzrflMj/gogfaoONZqL83LUeQScHAvyMbpqP5C9MzNf+fFwhQ==
+ version "5.1.1"
dependencies:
"@formatjs/fast-memoize" "2.2.1"
"@formatjs/intl-localematcher" "0.5.5"