diff --git a/simpledemo.html b/simpledemo.html index 2b72e73..99be39f 100644 --- a/simpledemo.html +++ b/simpledemo.html @@ -142,6 +142,10 @@ Save & Restore playing state (default no) + + Tell address at startup (default yes) + + WiFi SSID @@ -256,7 +260,7 @@ - +

- +

+ +
+

+ +

+
+
+

At startup, the NetSpeaker tells it's address with Google TTS when in operation mode 0, 2 or 3. + This can be turned on and off. On by default. +

+
+ + +
+
+
+
+

@@ -593,6 +621,8 @@ restoreStateSwitch1 = document.getElementById('updatedLabel_RESTORESTATE_switch') restorePlayingStateLabel1 = document.getElementById('updatedLabel_RESTOREPLAYING_table') restorePlayingStateSwitch1 = document.getElementById('updatedLabel_RESTOREPLAYING_switch') + tellAddressLabel1 = document.getElementById('updatedLabel_TELLADDRESS_table') + tellAddressSwitch1 = document.getElementById('updatedLabel_TELLADDRESS_switch') wifiLabel1 = document.getElementById('updatedLabel_WIFISSID_table'); apSsidLabel1 = document.getElementById('updatedLabel_APSSID_table'); apSsidLabel2 = document.getElementById('updatedLabel_APSSID_code'); @@ -639,6 +669,7 @@ frnameApiEndpoint = "/api/v1/system/name"; restoreStateApiEndpoint = "/api/v1/system/restore_state/get"; restorePlayingStateApiEndpoint = "/api/v1/system/restore_playing/get"; + tellAddressApiEndpoint = "/api/v1/system/tell_address/get"; wifiApiEndpoint = "/api/v1/system/wifi/get_ssid"; hostnameApiEndpoint = "/api/v1/system/network_name"; apApiEndpoint = "/api/v1/system/wifi/get_ap_creds"; @@ -710,6 +741,18 @@ restorePlayingRequest.open("GET", apiBase + restorePlayingStateApiEndpoint, true); restorePlayingRequest.send(); + /* Tell address parser */ + var tellAddressRequest = new XMLHttpRequest(); + tellAddressRequest.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + var tellAddressValue = JSON.parse(this.responseText).tell_address; + tellAddressLabel1.innerHTML = tellAddressValue ? "yes" : "no"; + tellAddressSwitch1.checked = tellAddressValue; + } + } + tellAddressRequest.open("GET", apiBase + tellAddressApiEndpoint, true); + tellAddressRequest.send(); + /* WiFi SSID parser */ var wifiRequest = new XMLHttpRequest(); @@ -722,6 +765,7 @@ wifiRequest.open("GET", apiBase + wifiApiEndpoint, true); wifiRequest.send(); + /* AP SSID and PSK parser */ var apRequest = new XMLHttpRequest(); apRequest.onreadystatechange = function() { @@ -931,4 +975,7 @@ updatedLabel_RS_YEAR_table_top updatedLabel_RS_GENRE_table_top updatedLabel_RS_COPYRIGHT_table_top updatedLabel_RS_LANGUAGE_table_top + +updatedLabel_TELLADDRESS_table +updatedLabel_TELLADDRESS_switch -->