Skip to content

Commit

Permalink
basic, day ahead only, style tweaked spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoDerp committed Mar 2, 2024
1 parent 867893e commit 3811b02
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
11 changes: 4 additions & 7 deletions src/emhass/static/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
<h4>Use the button below to manually launch optimization task</h4>
<div id=loader></div> <!-- status dynamic element -->
</div>
<button type="button" id="dayahead-optim-publish" class="button button1">Day-ahead Optimization & Publish</button>
<button type="button" id="dayahead-optim-basic" class="button button1">Day-ahead Optimization & Publish</button>
<div class="info">
<p>The day-ahead optimization button will run once, based on the values entered into the configuration page. </br>
After a
few seconds, the charts and table below should be updated to reflect the optimization plan for the next 24
hours.
<p>The day-ahead optimization button will run once, based on the values entered into the configuration page.
</br>
After a few seconds, the charts and table below should be updated to reflect the optimization plan for the next 24 hours.
</p>
<p>On success, this button will also run the publish action, publishing optimization results to Home Assistant
Sensors. </br> <i>(Timestamp based from the time the button was pressed)</i></p>
</div>
16 changes: 8 additions & 8 deletions src/emhass/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function loadButtons(page) {
document.getElementById("input-clear").addEventListener("click", () => ClearInputData());
break;
case "basic":
document.getElementById("dayahead-optim-publish").addEventListener("click", () => DayheadOptimPublish());
document.getElementById("dayahead-optim-basic").addEventListener("click", () => formAction("dayahead-optim", "basic"));
break;
}
}
Expand Down Expand Up @@ -402,13 +402,13 @@ async function ClearInputElements() {
}
}

//Run day ahead, then publish actions
async function DayheadOptimPublish() {
response = await formAction("dayahead-optim", "basic")
if (response) { //if successful publish data
formAction("publish-data", "basic")
}
}
// //Run day ahead, then publish actions
// async function DayheadOptimPublish() {
// response = await formAction("dayahead-optim", "basic")
// if (response) { //if successful publish data
// formAction("publish-data", "basic")
// }
//}



Expand Down
25 changes: 20 additions & 5 deletions src/emhass/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,29 @@ select {
box-shadow: #3d3d3d 3px 3px;
}

.info {

.alert, .info {
max-width: 50%;
}

.info {
margin: 0 auto;
margin-top: 1em;
margin-top: 2em;
padding-top: 1em;
}

h2 {
margin-bottom: .3em;
}

.table_div h4{
margin-top: .5em;
}

.info p {
line-height: 2em;
}

table {
max-width: 50%;
}
Expand Down Expand Up @@ -784,7 +800,6 @@ th {
/* Alert box styling */
.alert {
display: box;
max-width: fit-content;
overflow-x: auto;
align-items: center;
align-self: center;
Expand Down Expand Up @@ -917,8 +932,8 @@ th {
display: none !important;
}

.info {
max-width: 80%;
.info, .alert {
max-width: 100%;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/emhass/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>EMHASS: Energy Management Optimization for Home Assistant</h2>
</div>
</div>
<!-- -->
<br><br><br>
<br>
<!-- dynamic table/diagram elements section -->
</div>
<div id="template"> <!-- table/diagram container element -->
Expand Down

0 comments on commit 3811b02

Please sign in to comment.