mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Dashboard work around Hass.io bug (#575)
* Dashboard work around Hass.io bug Ref https://github.com/home-assistant/hassio/issues/1103 * Lint
This commit is contained in:
		| @@ -5,12 +5,13 @@ | ||||
| document.addEventListener('DOMContentLoaded', () => { | ||||
|   M.AutoInit(document.body); | ||||
| }); | ||||
| let wsProtocol = "ws:"; | ||||
| if (window.location.protocol === "https:") { | ||||
|   wsProtocol = 'wss:'; | ||||
| const loc = window.location; | ||||
| const wsLoc = new URL("./",`${loc.protocol}//${loc.host}${loc.pathname}`); | ||||
| wsLoc.protocol = 'ws:'; | ||||
| if (loc.protocol === "https:") { | ||||
|   wsLoc.protocol = 'wss:'; | ||||
| } | ||||
| const wsUrl = `${wsProtocol}//${window.location.host}${window.location.pathname}`; | ||||
|  | ||||
| const wsUrl = wsLoc.href; | ||||
|  | ||||
| // ============================= Color Log Parsing ============================= | ||||
| const initializeColorState = () => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user