Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/modules/web_themes/standard_legacy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

@auto_str
class StandardLegacyWebThemeConfiguration:
def __init__(self) -> None:
pass
def __init__(self,
history_chart_range: int = 30 * 60 * 1000 # 30 minutes in milliseconds
) -> None:
self.history_chart_range = history_chart_range


@auto_str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ function loadElectricityPriceChart() {
],
}

var ctxElectricityPricechart = $('#electricityPriceChartCanvas')[0].getContext('2d');
var ctxElectricityPriceChart = $('#electricityPriceChartCanvas')[0].getContext('2d');

window.electricityPricechart = new Chart(ctxElectricityPricechart, {
window.electricityPriceChart = new Chart(ctxElectricityPriceChart, {
type: 'line',
data: electricityPriceChartData,
options: {
Expand Down
12 changes: 6 additions & 6 deletions packages/modules/web_themes/standard_legacy/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1057,11 +1057,11 @@ <h4 class="modal-title">
<script>
function clearPriceForm() {
$("#maxPriceBox").val(0);
window.electricityPricechart.destroy();
window.electricityPriceChart.destroy();
}

function updatePriceChart() {
window.electricityPricechart.destroy();
window.electricityPriceChart.destroy();
loadElectricityPriceChart();
}

Expand Down Expand Up @@ -1244,13 +1244,13 @@ <h4 class="modal-title">
// some helper functions
'helperFunctions.js?ver=20240314',
// functions for processing messages
'processAllMqttMsg.js?ver=20240415',
'processAllMqttMsg.js?ver=20250326',
// respective Chart.js definition live
'livechart.js?ver=20240425',
'livechart.js?ver=20250326',
// respective Chart.js definition price based charging
'electricityPriceChart.js?ver=20240108',
'electricityPriceChart.js?ver=20250326',
// functions performing mqtt and start mqtt-service
'setupMqttServices.js?ver=20240415',
'setupMqttServices.js?ver=20250326',
];
scriptsToLoad.forEach(function (src) {
var script = document.createElement('script');
Expand Down
13 changes: 3 additions & 10 deletions packages/modules/web_themes/standard_legacy/web/livechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var smartHomeBgColor = style.getPropertyValue('--smartHomeDeviceBgCol');

var initialRead = 0;
var graphLoaded = 0;
var maxDisplayLength;
var all1 = 0;
var all2 = 0;
var all3 = 0;
Expand Down Expand Up @@ -471,11 +470,9 @@ function initDataset(datasetId) {
}

function truncateData(data) {
if (typeof maxDisplayLength !== "undefined") {
var limit = Date.now() - maxDisplayLength;
while (data[0].timestamp < limit) {
data.shift();
}
var limit = Date.now() - themeConfiguration.history_chart_range;
while (data[0].timestamp < limit) {
data.shift();
}
}

Expand Down Expand Up @@ -559,10 +556,6 @@ function checkGraphLoad() {

function forceGraphLoad() {
if (graphLoaded == 0) {
if (typeof maxDisplayLength === "undefined") {
console.warn("setting graph duration to default of 30 minutes");
maxDisplayLength = 30 * 60 * 1000; // 30 minutes in milliseconds
}
checkGraphLoad();
}
} // end forceGraphLoad
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

// add topics here which should be subscribed before any other topics
var topicsToSubscribeFirst = [
["openWB/general/web_theme", 0], // theme configuration
["openWB/counter/get/hierarchy", 0] // hierarchy of all counters and charge points
];

Expand Down Expand Up @@ -80,7 +81,6 @@ var topicsToSubscribe = [
["openWB/optional/dc_charging", 1], // dc charging is configured

// graph topics
["openWB/graph/config/duration", 1], // maximum duration to display in landing page
["openWB/graph/alllivevaluesJson1", 1],
["openWB/graph/alllivevaluesJson2", 1],
["openWB/graph/alllivevaluesJson3", 1],
Expand All @@ -98,7 +98,6 @@ var topicsToSubscribe = [
["openWB/graph/alllivevaluesJson15", 1],
["openWB/graph/alllivevaluesJson16", 1],
["openWB/graph/lastlivevaluesJson", 1],

];

// holds number of topics flagged 1 initially
Expand Down
20 changes: 10 additions & 10 deletions packages/modules/web_themes/standard_legacy/web/smartHome.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
</div>

<!-- SmartHome Device 1 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="1">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="1">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand Down Expand Up @@ -183,7 +183,7 @@
</div><!-- SmartHome Device 1 -->

<!-- SmartHome Device 2 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="2">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="2">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand Down Expand Up @@ -217,7 +217,7 @@
</div><!-- SmartHome Device 2 -->

<!-- SmartHome Device 3 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="3">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="3">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -237,7 +237,7 @@
</div><!-- SmartHome Device 3 -->

<!-- SmartHome Device 4 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="4">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="4">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -257,7 +257,7 @@
</div><!-- SmartHome Device 4 -->

<!-- SmartHome Device 5 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="5">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="5">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -277,7 +277,7 @@
</div><!-- SmartHome Device 5 -->

<!-- SmartHome Device 6 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="6">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="6">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -297,7 +297,7 @@
</div><!-- SmartHome Device 6 -->

<!-- SmartHome Device 7 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="7">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="7">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -317,7 +317,7 @@
</div><!-- SmartHome Device 7 -->

<!-- SmartHome Device 8 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="8">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="8">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand All @@ -337,7 +337,7 @@
</div><!-- SmartHome Device 8 -->

<!-- SmartHome Device 9 -->
<div class="smarthome-device-card card border-dark text-grey hide" data-smart-home-device="9">
<div class="smart-home-device-card card border-dark text-grey hide" data-smart-home-device="9">
<div class="card-header bg-lightgrey">
<div class="form-row">
<div class="col-3">
Expand Down Expand Up @@ -455,7 +455,7 @@
// some helper functions
'helperFunctions.js?ver=20221117',
// functions for processing messages
'processAllMqttMsg.js?ver=20230606',
'processAllMqttMsg.js?ver=20250317',
// functions performing mqtt and start mqtt-service
'smartHomeMqttServices.js?ver=20230606',
];
Expand Down