Skip to content

Commit

Permalink
Don't configure MQTT update topic by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sidoh committed Oct 20, 2024
1 parent 644f87d commit 4961eae
Show file tree
Hide file tree
Showing 9 changed files with 471 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dist/bundle.js.gz.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.html.gz.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define index_html_gz_len 1822
static const char index_html_filename[] = "/dist/index.89b5b033.html";
static const char index_html_gz[] PROGMEM = {31,139,8,0,0,0,0,0,2,10,237,88,91,115,218,200,18,126,79,213,254,135,89,157,108,149,40,97,13,118,192,96,108,92,103,144,112,236,4,99,145,216,187,235,108,109,109,132,52,186,24,33,113,70,3,2,187,248,239,167,71,18,32,1,78,242,112,222,78,84,197,92,187,123,190,238,233,203,20,111,46,126,213,239,180,251,71,163,135,60,62,9,46,223,92,136,14,5,102,232,118,36,26,74,98,129,154,54,116,19,202,77,100,121,38,139,41,239,72,15,247,87,71,45,105,189,28,154,19,218,145,230,62,77,166,17,227,18,178,162,144,211,16,200,18,223,230,94,199,166,115,223,162,71,233,164,138,252,208,231,190,25,28,197,150,25,208,206,177,90,19,98,184,207,3,122,121,235,247,125,215,227,232,122,54,186,192,217,210,155,139,192,15,199,200,99,212,233,72,182,201,205,182,63,49,93,138,23,71,62,156,114,62,50,99,122,90,175,18,66,186,132,244,72,15,90,209,107,164,27,117,135,132,92,185,48,213,68,67,134,162,185,33,235,253,245,215,35,229,175,60,199,239,90,3,210,213,21,45,209,241,211,48,38,103,211,135,59,210,253,52,195,48,191,30,38,68,113,13,70,140,250,237,136,144,47,45,167,69,180,197,232,12,230,239,199,137,246,7,38,17,209,31,159,20,98,52,206,180,161,222,188,34,99,162,97,28,146,15,143,31,241,144,12,113,82,39,150,59,199,196,104,30,107,137,246,89,55,90,68,33,227,71,152,51,80,99,128,149,26,193,139,158,69,140,99,166,37,228,22,71,99,162,59,202,53,185,193,77,80,169,143,27,49,209,141,179,6,33,181,7,192,83,199,46,204,255,100,10,88,226,14,187,122,160,97,144,55,175,13,8,121,135,123,73,183,222,3,124,173,132,53,137,81,187,161,32,191,105,212,201,200,105,245,9,153,125,192,137,246,187,62,7,122,207,122,79,180,107,69,119,187,207,56,137,65,191,38,38,221,123,229,203,144,220,106,243,26,49,221,16,147,15,247,88,31,234,74,207,16,231,55,99,114,231,96,157,232,88,95,0,94,247,4,110,162,62,192,110,183,134,221,132,232,95,158,129,191,15,246,2,252,221,71,162,36,255,185,37,63,191,159,223,207,239,255,252,131,60,87,250,30,98,104,148,65,66,200,251,231,155,205,234,205,83,141,124,244,8,185,246,90,249,74,36,154,65,58,236,38,105,138,134,95,129,35,253,38,68,164,124,61,126,42,172,125,238,39,175,64,233,222,134,131,242,10,187,213,147,223,251,159,202,181,64,215,31,236,215,180,249,160,23,104,181,135,186,232,62,234,101,21,175,52,65,99,137,225,105,161,214,252,153,131,16,53,233,143,190,75,76,178,197,217,255,8,85,235,110,40,228,212,203,96,186,99,99,51,54,26,96,3,125,242,5,248,90,99,176,83,127,14,56,53,71,1,222,103,12,233,214,192,194,70,142,2,205,53,118,243,57,84,27,160,15,241,56,167,215,151,247,48,111,76,172,92,30,233,72,136,209,160,35,137,50,43,33,190,156,66,133,47,150,94,9,97,40,206,49,95,138,34,141,208,191,130,200,180,253,208,69,47,48,65,104,26,197,80,229,163,176,141,28,127,65,237,243,116,145,71,211,54,106,212,126,203,102,1,117,120,97,202,153,25,198,78,196,38,237,108,24,152,156,202,71,176,93,69,162,173,100,84,14,188,44,142,98,255,153,182,209,73,125,186,40,44,58,230,196,15,150,109,68,24,60,46,170,40,6,17,71,49,101,190,35,104,86,111,46,112,14,245,34,182,152,63,229,151,178,51,11,45,1,17,201,21,244,242,11,16,129,82,49,71,150,29,118,225,81,129,58,72,242,56,159,198,109,140,97,73,125,138,109,26,248,115,166,134,148,99,215,195,177,111,71,30,166,241,180,117,114,122,250,15,28,45,30,46,255,120,179,209,191,19,58,58,193,105,99,251,49,199,115,202,98,56,37,198,240,210,81,143,177,116,190,61,202,241,3,26,195,65,127,253,146,170,241,146,117,40,53,118,27,73,41,224,216,163,148,75,213,245,22,64,49,76,238,181,55,48,21,36,141,102,161,29,80,213,138,227,45,93,16,193,235,42,163,148,82,24,107,34,122,118,218,28,89,163,50,117,102,208,169,120,219,221,132,92,150,90,239,26,199,82,21,29,215,42,57,201,170,250,10,196,212,150,63,4,239,233,7,208,217,167,13,235,244,180,89,47,17,239,130,59,57,62,171,55,234,7,224,253,13,166,21,253,230,98,45,70,193,137,62,111,204,216,135,151,164,44,94,146,149,181,34,217,61,164,47,204,14,178,35,107,54,129,103,171,154,241,245,2,42,102,178,36,182,165,202,121,198,33,38,42,4,134,240,143,194,5,21,119,197,9,176,45,186,124,153,81,62,99,97,186,155,174,172,14,3,77,141,41,199,204,218,193,151,89,249,27,8,243,107,88,99,204,166,42,8,2,30,104,203,203,54,117,40,131,13,206,102,180,140,47,35,56,136,144,179,101,31,2,252,129,5,242,140,137,240,130,75,169,10,62,182,212,162,89,40,192,213,170,104,98,46,62,193,146,159,122,117,99,163,69,46,222,161,220,242,4,123,101,125,181,42,247,104,40,203,12,194,8,20,165,21,212,185,220,186,24,66,190,131,228,95,215,155,106,52,174,20,55,193,7,61,22,37,40,164,9,234,49,22,49,89,26,80,158,68,108,140,214,44,40,49,99,20,70,28,69,219,251,75,221,101,59,204,161,25,44,154,248,112,6,112,70,193,156,110,17,109,184,86,91,208,150,41,244,144,169,56,244,16,228,130,85,46,10,38,217,65,47,174,54,2,159,79,76,22,202,95,5,205,82,164,207,183,47,96,160,21,146,223,190,20,196,40,232,120,133,223,190,108,101,173,42,95,139,10,109,244,248,238,53,129,164,226,53,149,172,130,104,0,54,59,96,226,84,211,67,246,91,85,190,229,44,87,144,222,100,145,227,118,220,217,143,117,58,167,65,52,21,206,43,226,104,202,34,123,150,178,74,168,211,129,5,123,187,191,142,44,97,216,18,99,193,156,251,202,139,83,213,77,150,169,166,153,86,205,140,1,110,90,91,171,189,171,242,43,130,242,172,182,47,102,237,10,194,11,182,230,249,97,28,141,141,79,109,0,29,50,167,168,172,6,20,94,121,163,114,64,161,78,205,24,3,51,8,35,223,132,54,93,136,8,204,19,224,14,239,128,46,82,50,185,96,50,97,206,61,9,151,157,172,36,169,1,13,93,238,149,28,118,147,122,92,202,243,188,211,93,222,216,144,29,179,186,47,85,212,52,29,170,144,207,167,129,185,20,247,26,70,33,149,206,119,131,109,27,82,107,180,197,122,136,114,12,127,237,162,251,251,124,75,190,231,96,219,51,190,147,82,190,155,84,14,164,149,43,19,142,176,225,245,146,90,51,133,39,149,163,111,117,32,20,55,71,140,130,104,36,151,2,109,31,174,160,217,135,154,89,5,2,25,140,242,240,169,159,103,253,187,209,19,181,56,204,51,174,18,16,225,24,52,187,157,130,185,214,106,167,222,39,42,119,22,101,133,242,181,103,132,92,8,28,124,176,136,138,36,94,182,64,22,73,135,78,201,107,211,119,79,200,170,223,190,228,178,30,27,63,20,127,75,169,230,116,74,67,91,243,252,192,150,115,129,101,238,93,47,82,148,178,189,74,225,241,218,29,125,43,225,111,19,121,186,45,127,61,224,45,109,200,234,197,68,178,250,90,205,114,234,255,10,235,54,123,100,3,140,209,103,110,50,142,214,143,242,52,164,242,220,177,47,38,231,219,152,214,180,237,222,28,6,125,120,154,209,144,66,8,232,119,183,90,246,159,158,136,59,106,195,235,75,46,90,98,155,162,50,129,162,91,85,210,25,60,188,179,7,55,140,242,191,18,71,145,189,132,206,246,231,200,183,59,210,20,24,165,194,124,157,81,46,251,217,64,85,213,11,120,75,207,133,132,188,203,37,224,236,63,203,255,2,165,179,47,34,197,20,0,0};
#define index_html_gz_len 1833
static const char index_html_filename[] = "/dist/index.e0af0d7a.html";
static const char index_html_gz[] PROGMEM = {31,139,8,0,0,0,0,0,2,10,237,88,109,115,218,184,22,254,222,153,253,15,170,183,59,99,198,196,130,4,2,33,33,179,194,38,77,90,66,160,77,118,55,221,217,217,26,91,126,9,198,230,202,2,67,50,252,247,123,100,27,176,129,180,253,112,191,221,122,6,203,146,142,142,158,243,232,188,104,120,115,241,86,191,211,238,31,7,93,228,242,137,127,249,230,66,52,200,55,2,167,45,209,64,18,3,212,176,160,153,80,110,32,211,53,88,68,121,91,122,184,191,58,106,74,235,225,192,152,208,182,52,247,104,60,13,25,151,144,25,6,156,6,32,22,123,22,119,219,22,157,123,38,61,74,58,101,228,5,30,247,12,255,40,50,13,159,182,171,106,69,168,225,30,247,233,229,173,215,243,28,151,163,235,217,232,2,167,67,111,46,124,47,24,35,151,81,187,45,89,6,55,90,222,196,112,40,94,28,121,176,203,249,200,136,232,105,173,76,8,233,16,210,37,93,120,139,86,35,157,176,51,36,228,202,129,174,38,94,100,40,94,55,100,61,191,126,186,164,248,20,251,248,164,217,39,29,93,209,98,29,63,13,35,114,54,125,184,35,157,79,51,12,253,235,97,76,20,103,192,200,160,118,59,34,228,75,211,110,18,109,49,58,131,254,251,113,172,253,137,73,72,244,199,39,133,12,234,103,218,80,111,92,145,49,209,48,14,200,135,199,143,120,72,134,56,174,17,211,153,99,50,104,84,181,88,251,172,15,154,68,33,227,71,232,51,48,163,143,149,10,193,139,174,73,6,85,166,197,228,22,135,99,162,219,202,53,185,193,13,48,169,135,235,17,209,7,103,117,66,42,15,128,167,134,29,232,255,197,20,96,226,14,59,186,175,97,208,55,175,244,9,57,193,221,184,83,235,2,190,102,204,26,100,80,185,161,160,191,49,168,145,145,221,236,17,50,251,128,99,237,15,125,14,242,174,249,158,104,215,138,238,116,158,113,28,129,125,13,76,58,247,202,151,33,185,213,230,21,98,56,1,38,31,238,177,62,212,149,238,64,236,223,136,200,157,141,117,162,99,125,1,120,157,99,56,137,90,31,59,157,10,118,98,162,127,121,134,245,61,224,11,240,119,30,137,18,255,231,150,252,124,126,62,63,159,255,243,7,242,92,225,121,136,224,165,244,99,66,222,63,223,108,70,111,158,42,228,163,75,200,181,219,204,70,66,241,234,39,159,157,56,73,209,240,203,173,72,158,9,17,41,95,143,158,114,99,159,123,241,43,80,58,183,65,191,56,194,110,245,248,143,222,167,98,45,208,245,7,235,53,107,62,232,57,89,237,161,38,154,143,122,209,196,43,77,200,152,226,243,52,87,107,254,202,64,136,154,244,103,207,33,6,217,226,236,125,132,170,117,55,20,122,106,69,48,157,241,96,243,61,168,3,7,250,228,11,172,107,142,129,167,222,28,112,106,182,2,107,159,49,164,219,1,22,28,217,10,188,174,177,147,245,161,218,128,124,128,199,153,188,190,188,135,126,125,98,102,250,72,91,66,140,250,109,73,148,89,9,241,229,20,42,124,190,244,74,8,67,113,142,248,82,20,105,132,126,245,67,195,242,2,7,189,64,7,161,105,24,65,149,15,131,22,178,189,5,181,206,147,65,30,78,91,168,94,249,45,237,249,212,230,185,46,103,70,16,217,33,155,180,210,79,223,224,84,62,130,233,50,18,239,82,42,101,195,205,226,40,242,158,105,11,29,215,166,139,220,160,109,76,60,127,217,66,132,193,229,162,140,34,80,113,20,81,230,217,66,102,245,230,2,103,80,47,34,147,121,83,126,41,219,179,192,20,16,145,92,66,47,191,128,16,24,21,113,100,90,65,7,46,21,168,141,36,151,243,105,212,194,24,134,212,167,200,162,190,55,103,106,64,57,118,92,28,121,86,232,98,26,77,155,199,167,167,255,194,214,226,226,242,175,59,27,253,30,211,209,49,78,94,150,23,113,60,167,44,130,93,34,12,55,29,245,4,75,231,219,173,108,207,167,17,108,244,247,47,137,25,47,105,131,18,178,91,72,74,0,71,46,165,92,42,175,167,0,202,192,224,110,107,3,83,65,210,104,22,88,62,85,205,40,218,202,249,33,220,174,82,73,41,129,177,22,162,103,167,141,145,57,42,74,167,132,78,197,221,238,38,224,178,212,60,169,87,165,50,170,86,74,153,200,170,252,10,196,132,203,31,130,247,244,3,232,26,39,213,170,81,173,158,21,132,119,193,29,87,207,78,79,234,7,224,253,3,212,138,118,115,176,38,163,224,68,159,55,52,246,224,38,41,139,155,100,105,109,72,122,14,201,13,179,141,172,208,156,77,224,218,170,166,235,186,62,21,61,89,18,211,82,233,60,93,33,58,42,4,134,240,143,220,1,229,103,197,14,48,45,154,108,152,81,62,99,65,50,155,140,172,14,3,77,200,148,35,102,238,224,75,89,254,6,194,236,24,214,24,211,174,10,138,96,13,188,139,195,22,181,41,131,9,206,102,180,136,47,21,56,136,144,179,101,15,2,252,129,249,242,140,137,240,130,67,41,139,117,108,169,133,179,64,128,171,148,209,196,88,124,130,33,47,241,234,250,198,138,76,189,77,185,233,138,229,165,245,209,170,220,165,129,44,51,8,35,48,148,150,80,251,114,235,98,8,121,54,146,223,174,39,213,112,92,202,79,130,15,186,44,140,81,64,99,212,101,44,100,178,212,167,60,14,217,24,173,151,160,216,136,80,16,114,20,110,207,47,113,151,237,103,6,109,192,194,137,7,123,192,202,208,159,211,45,162,205,170,213,22,180,105,8,59,100,42,54,61,4,57,199,202,69,142,146,29,244,226,104,67,240,249,216,96,129,252,85,200,44,69,250,124,247,2,4,173,144,252,238,37,167,70,65,213,21,126,247,178,213,181,42,125,205,27,180,177,227,187,199,4,154,242,199,84,96,5,81,31,56,59,64,113,98,233,33,254,86,165,111,57,203,21,164,55,89,228,184,29,119,246,34,157,206,169,31,78,133,243,138,56,154,178,208,154,37,75,37,212,110,195,128,181,157,95,71,150,32,182,176,48,71,231,190,241,98,87,117,147,101,202,73,166,85,83,50,192,77,43,107,179,119,77,126,69,81,150,213,246,213,172,93,65,120,193,150,158,31,198,81,223,248,212,6,208,33,58,69,101,29,64,225,149,55,38,251,20,234,212,140,49,160,65,144,124,19,88,116,33,34,48,75,128,59,107,251,116,145,136,201,57,202,4,157,123,26,46,219,105,73,82,125,26,56,220,45,56,236,38,245,56,148,103,121,167,179,188,177,32,59,166,117,95,42,169,73,58,84,33,159,79,125,99,41,206,53,8,3,42,157,239,6,219,54,164,214,104,243,245,16,101,24,254,222,69,247,207,249,86,124,207,193,182,123,124,39,165,124,55,169,28,72,43,87,6,108,97,193,237,37,97,51,129,39,21,163,111,117,32,20,55,91,140,252,112,36,23,2,109,31,174,144,217,135,154,178,2,129,12,164,60,124,234,101,89,255,110,244,68,77,14,253,116,85,1,136,112,12,154,158,78,142,174,181,217,137,247,137,202,157,70,89,174,124,237,145,144,41,129,141,15,22,81,145,196,139,12,164,145,116,104,151,172,54,125,119,135,180,250,237,107,46,218,177,241,67,241,183,148,106,76,167,52,176,52,215,243,45,57,83,88,92,189,235,69,138,82,228,171,16,30,175,157,209,183,18,254,54,145,39,211,242,215,3,222,210,130,172,158,79,36,171,175,229,52,167,254,175,176,110,179,71,250,129,49,250,204,13,198,209,250,82,158,132,84,150,59,246,213,100,235,54,212,26,150,213,157,195,71,15,174,102,52,160,16,2,250,221,173,150,254,167,39,226,142,90,112,251,146,243,76,108,83,84,170,80,52,171,82,210,131,139,119,122,225,134,175,236,175,196,81,104,45,145,233,27,81,36,254,210,99,99,241,7,160,229,205,145,103,181,165,41,104,201,247,215,233,229,178,151,126,168,170,122,1,23,235,185,80,151,53,66,93,162,61,249,3,243,191,89,224,218,225,210,20,0,0};
1 change: 0 additions & 1 deletion lib/Settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class Settings {
listenRepeats(3),
discoveryPort(48899),
mqttTopicPattern("milight/commands/:device_id/:device_type/:group_id"),
mqttUpdateTopicPattern("milight/updates/:device_id/:device_type/:group_id"),
mqttStateTopicPattern("milight/state/:device_id/:device_type/:group_id"),
mqttClientStatusTopic("milight/client_status"),
simpleMqttClientStatus(true),
Expand Down
1 change: 1 addition & 0 deletions web2/dist/versions/1.0.3/bundle.css

Large diffs are not rendered by default.

327 changes: 327 additions & 0 deletions web2/dist/versions/1.0.3/bundle.js

Large diffs are not rendered by default.

133 changes: 133 additions & 0 deletions web2/dist/versions/1.0.3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MiLight Hub</title>
<link href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAA/38NABD+CwD/jQsA9pUOABRu/wD/HQwA+gPrAP4MbAAZ8f8ACxb9AP4GkwCW/AoADYj+AP59CQD7FAkAC//nAJYK/QAQ/w4Acgv/AP71CwCSDP8A+AkYAP7rBAAN/+0A/xEcAP1rCwAM/okADf+HAI/7CgAL/5sADP95AA0U/wD4/gsADXr+ABAO/gDlC/8A+v0NAA3/EwB4Ef8A8wr7AP0IeAAN7P4Abf8LAAuJ/wCVDv8A+hcGACH+DgBz/wsA+g7/ABT+ZQAMCv0Aagn/AJT/DQD+EPsADP7sAOf/DAD/Dx0A/g2AAB4N/gB0/gwADZz/ABLu/wAM/BYA+wqMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkYAAAAAAAAAAAAAAUsAAA+NwAAGzIAAAAAAAAAIj0AKhAAHh8AAAAAAAoAAAANAAAAABwAAAA/AAAzIAAAAAAAAAAAAAAmAgAAADsjAAAAAAAAAAASLwAAAAAAAAAAAAAAAAAAAAAAABMnNAAAAAAAAAAAAAArMDwVLREAAAAAAAAAAAAADDUdAAAAAAAAAAAAAAAAAAAAAAAAJDEAAAAAAAAAACU4AAAAKDYAAAAAAAAAAAAAFCEAAAcAAAA6AAAAAAEAAAAXAAAAAABACAAWLgAaAwAAAAAAAAALKQAAOQYAAA4EAAAAAAAAAAAAABkPAAAAAAAAAP5/AADmZwAA8k8AALvdAACf+QAAz/MAAP//AAAf+AAAH/gAAP//AADP8wAAn/kAALvdAADyTwAA5mcAAP5/AAA=" rel="icon" type="image/x-icon" />
<style>
#loading {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
font-family: Arial, sans-serif;
}
</style>
<script>(function () {
const cdnBase = "https://cdn.jsdelivr.net/gh/sidoh/esp8266_milight_hub@web2/web2/dist/versions/1.0.3/";
const files = [
{
type: "stylesheet",
cdnPath: cdnBase + "bundle.css",
localPath: "dist/bundle.ce967bcb.css",
size: parseInt("8351", 10),
},
{
type: "script",
cdnPath: cdnBase + "bundle.js",
localPath: "dist/bundle.7311a119.js",
size: parseInt("219635", 10),
},
];

function createStylesheetLink(href) {
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = href;
return link;
}

function createScript(src) {
const script = document.createElement("script");
script.src = src;
script.defer = true;
return script;
}

function tryLoadUrl(url, size, retryCount = 0, maxRetries = 5) {
return fetch(url)
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
}
return Promise.resolve(response);
})
.catch((error) => {
if (retryCount < maxRetries) {
console.warn(`Retrying ${url} (${retryCount + 1}/${maxRetries})`);
return tryLoadUrl(url, size, retryCount + 1, maxRetries);
} else {
throw error;
}
});
}

function tryLoadFile(file) {
const isDevelopment = "production" === "development";
if (isDevelopment) {
return tryLoadUrl(file.localPath, file.size, 0, 0);
} else {
return tryLoadUrl(file.cdnPath, file.size, 0, 0).catch(() =>
tryLoadUrl(file.localPath, file.size, 0, 5)
);
}
}

function loadPage() {
let currentFileIndex = 0;

function loadNextFile() {
if (currentFileIndex >= files.length) {
document.getElementById("loading").style.display = "none";
return;
}

const file = files[currentFileIndex];

tryLoadFile(file)
.then((response) => {
if (!response.ok) {
throw new Error("Failed to load file");
}
return response.blob();
})
.then((blob) => {
const url = URL.createObjectURL(blob);
let element;

if (file.type === "stylesheet") {
element = createStylesheetLink(url);
} else if (file.type === "script") {
element = createScript(url);
}

document.head.appendChild(element);
currentFileIndex++;
loadNextFile();
})
.catch((error) => {
console.error(`Failed to load file: ${file.cdnPath}`, error);
currentFileIndex++;
loadNextFile();
});
}

// Start loading files
loadNextFile();
}

document.addEventListener("DOMContentLoaded", () => {
loadPage();
});
})();
</script>
</head>
<body class="dark">
<div id="page">
<div id="loading">Loading...</div>
</div>
</body>
</html>
4 changes: 2 additions & 2 deletions web2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esp8266_milight_hub_ui",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions web2/src/pages/settings/section-mqtt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ type SettingsKey = keyof typeof schemas.Settings.shape;
const TOPIC_PRESETS: Record<string, Partial<Settings>> = {
Default: {
mqtt_topic_pattern: "milight/commands/:device_id/:device_type/:group_id",
mqtt_update_topic_pattern:
"milight/updates/:device_id/:device_type/:group_id",
mqtt_update_topic_pattern: "",
mqtt_state_topic_pattern: "milight/state/:device_id/:device_type/:group_id",
mqtt_client_status_topic: "milight/client_status",
simple_mqtt_client_status: true,
Expand Down

0 comments on commit 4961eae

Please sign in to comment.