emhass 0.7.8__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- emhass/static/style.css +2 -1
- emhass/templates/index.html +30 -5
- emhass/web_server.py +6 -4
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/METADATA +2 -2
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/RECORD +9 -9
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/LICENSE +0 -0
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/WHEEL +0 -0
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/entry_points.txt +0 -0
- {emhass-0.7.8.dist-info → emhass-0.8.0.dist-info}/top_level.txt +0 -0
emhass/static/style.css
CHANGED
emhass/templates/index.html
CHANGED
@@ -44,6 +44,7 @@
|
|
44
44
|
<option value="List" selected>List</option>
|
45
45
|
<option value="Box">Box</option>
|
46
46
|
</select>
|
47
|
+
<button type="button" id="input-clear">Clear</button>
|
47
48
|
</div>
|
48
49
|
</div>
|
49
50
|
<div id="input-container"> <!-- (Box/List) dynamic input elements will be added here -->
|
@@ -175,7 +176,7 @@
|
|
175
176
|
if (testStorage()) { //if local storage exists and works
|
176
177
|
let selectElement = document.getElementById('input-select') // select button element
|
177
178
|
var input_container = document.getElementById('input-container'); // container div containing all dynamic input elements (Box/List)
|
178
|
-
if (localStorage.getItem("input_container_content")) { //If items already stored in local storage, then override default
|
179
|
+
if (localStorage.getItem("input_container_content") && localStorage.getItem("input_container_content") !== "{}" ) { //If items already stored in local storage, then override default
|
179
180
|
if (selectElement.value == "Box") { //if Box is selected, show saved json data into box
|
180
181
|
document.getElementById("text-area").value = localStorage.getItem("input_container_content");
|
181
182
|
}
|
@@ -299,10 +300,7 @@
|
|
299
300
|
//if box is selected, remove input-list elements and replace (with text-area)
|
300
301
|
if (selectElement.value == "Box") {
|
301
302
|
if (input_container_child_name == "input-list" || input_container_child === null) { // if input list exists or no Box element
|
302
|
-
|
303
|
-
while (inputListArr[0]) { //while there is still input-list elements remove
|
304
|
-
inputListArr[0].parentNode.removeChild(inputListArr[0]);
|
305
|
-
};
|
303
|
+
input_container.innerHTML = ""; //remove input-list list elements via erasing container innerHTML
|
306
304
|
let div = document.createElement('div'); //add input-box element
|
307
305
|
div.className = "input-box";
|
308
306
|
div.innerHTML = `
|
@@ -325,6 +323,30 @@
|
|
325
323
|
}
|
326
324
|
}
|
327
325
|
|
326
|
+
//clear stored input data from localStorage (if any), clear input elements
|
327
|
+
async function ClearInputData(id) {
|
328
|
+
if (testStorage() && localStorage.getItem("input_container_content") !== null) {
|
329
|
+
localStorage.setItem("input_container_content", "{}")
|
330
|
+
}
|
331
|
+
ClearInputElements();
|
332
|
+
|
333
|
+
}
|
334
|
+
|
335
|
+
//clear input elements
|
336
|
+
async function ClearInputElements() {
|
337
|
+
let selectElement = document.getElementById('input-select')
|
338
|
+
var input_container = document.getElementById('input-container');
|
339
|
+
if (selectElement.value == "Box") {
|
340
|
+
document.getElementById("text-area").value = "{}";
|
341
|
+
}
|
342
|
+
if (selectElement.value == "List") {
|
343
|
+
input_container.innerHTML = "";
|
344
|
+
}
|
345
|
+
|
346
|
+
}
|
347
|
+
|
348
|
+
|
349
|
+
|
328
350
|
//add listeners to buttons
|
329
351
|
[
|
330
352
|
"dayahead-optim",
|
@@ -344,6 +366,9 @@
|
|
344
366
|
[
|
345
367
|
"input-select"
|
346
368
|
].forEach((id) => document.getElementById(id).addEventListener('change', () => getSavedData(id)));
|
369
|
+
[
|
370
|
+
"input-clear"
|
371
|
+
].forEach((id) => document.getElementById(id).addEventListener('click', () => ClearInputData(id)));
|
347
372
|
</script>
|
348
373
|
|
349
374
|
</html>
|
emhass/web_server.py
CHANGED
@@ -205,12 +205,14 @@ if __name__ == "__main__":
|
|
205
205
|
use_options = os.getenv('USE_OPTIONS', default=False)
|
206
206
|
# Define the paths
|
207
207
|
if args.addon==1:
|
208
|
-
OPTIONS_PATH = os.getenv('OPTIONS_PATH', default="/
|
208
|
+
OPTIONS_PATH = os.getenv('OPTIONS_PATH', default="/app/options.json")
|
209
209
|
options_json = Path(OPTIONS_PATH)
|
210
|
-
CONFIG_PATH = os.getenv("CONFIG_PATH", default="/
|
210
|
+
CONFIG_PATH = os.getenv("CONFIG_PATH", default="/app/config_emhass.yaml")
|
211
211
|
#Obtain url and key from ENV or ARG
|
212
212
|
hass_url = os.getenv("EMHASS_URL", default=args.url)
|
213
|
-
key = os.getenv("
|
213
|
+
key = os.getenv("SUPERVISOR_TOKEN", default=args.key)
|
214
|
+
if hass_url != "http://supervisor/core/api":
|
215
|
+
key = os.getenv("EMHASS_KEY", key)
|
214
216
|
#If url or key is None, Set as empty string to reduce NoneType errors bellow
|
215
217
|
if key is None: key = ""
|
216
218
|
if hass_url is None: hass_url = ""
|
@@ -220,7 +222,7 @@ if __name__ == "__main__":
|
|
220
222
|
options = json.load(data)
|
221
223
|
else:
|
222
224
|
app.logger.error("options.json does not exists")
|
223
|
-
DATA_PATH = os.getenv("DATA_PATH", default="/
|
225
|
+
DATA_PATH = os.getenv("DATA_PATH", default="/app/data/")
|
224
226
|
else:
|
225
227
|
if use_options:
|
226
228
|
OPTIONS_PATH = os.getenv('OPTIONS_PATH', default="/app/options.json")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: emhass
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.8.0
|
4
4
|
Summary: An Energy Management System for Home Assistant
|
5
5
|
Home-page: https://github.com/davidusb-geek/emhass
|
6
6
|
Author: David HERNANDEZ
|
@@ -460,7 +460,7 @@ Check the dedicated section in the documentation here: [https://emhass.readthedo
|
|
460
460
|
|
461
461
|
## Development
|
462
462
|
|
463
|
-
Pull request are very much accepted on this project. For development you can find some instructions here [Development](
|
463
|
+
Pull request are very much accepted on this project. For development you can find some instructions here [Development](https://emhass.readthedocs.io/en/latest/develop.html)
|
464
464
|
|
465
465
|
## Troubleshooting
|
466
466
|
|
@@ -5,15 +5,15 @@ emhass/machine_learning_forecaster.py,sha256=8Rm0-pltsjIYqLv01zCeO_Ij_n2HKC62dv_
|
|
5
5
|
emhass/optimization.py,sha256=7CM5_oA16ai40RSBk_izwOPxnq-GPyGQDUjTffIp0lI,36887
|
6
6
|
emhass/retrieve_hass.py,sha256=i9kPsrIRLsl985wZERGdYbGcB79KV-NQYSmrs-_cZAk,18314
|
7
7
|
emhass/utils.py,sha256=Slme0gYyXE9LwWO-8yOALZua7civhdhCoiv0h89ivdA,46114
|
8
|
-
emhass/web_server.py,sha256=
|
9
|
-
emhass/static/style.css,sha256=
|
8
|
+
emhass/web_server.py,sha256=qGfkjlMr5UDD-UsuWpTPiJG-yyGm8cONsokws5qzB8s,18177
|
9
|
+
emhass/static/style.css,sha256=E1whggyNxv7U8nF-KSJMic6ZBuakjkJm_wIEXvaWcFI,13293
|
10
10
|
emhass/static/img/emhass_icon.png,sha256=Kyx6hXQ1huJLHAq2CaBfjYXR25H9j99PSWHI0lShkaQ,19030
|
11
11
|
emhass/static/img/emhass_logo_short.svg,sha256=yzMcqtBRCV8rH84-MwnigZh45_f9Eoqwho9P8nCodJA,66736
|
12
|
-
emhass/templates/index.html,sha256=
|
12
|
+
emhass/templates/index.html,sha256=1TNIX34_Z92RGBan-8M_dF5ptO4b-D9V40KCpjdJzgc,17939
|
13
13
|
emhass/templates/template.html,sha256=TkGgMecQEbFUZA4ymPwMUzNjKHsENvCgroUWbPt7G4Y,158
|
14
|
-
emhass-0.
|
15
|
-
emhass-0.
|
16
|
-
emhass-0.
|
17
|
-
emhass-0.
|
18
|
-
emhass-0.
|
19
|
-
emhass-0.
|
14
|
+
emhass-0.8.0.dist-info/LICENSE,sha256=1X3-S1yvOCBDBeox1aK3dq00m7dA8NDtcPrpKPISzbE,1077
|
15
|
+
emhass-0.8.0.dist-info/METADATA,sha256=-06Yn_Uyb32Etf0U375lePGY9h3VQUiUiLfjPVSezuo,33456
|
16
|
+
emhass-0.8.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
17
|
+
emhass-0.8.0.dist-info/entry_points.txt,sha256=6Bp1NFOGNv_fSTxYl1ke3K3h3aqAcBxI-bgq5yq-i1M,52
|
18
|
+
emhass-0.8.0.dist-info/top_level.txt,sha256=L7fIX4awfmxQbAePtSdVg2e6x_HhghfReHfsKSpKr9I,7
|
19
|
+
emhass-0.8.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|