From c82b64e2573441f373b8de15aca6c6b830e3eb65 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 4 Jul 2024 21:55:08 +0200 Subject: [PATCH 1/3] see if it fixes adjust GitHub actions so they only run for ems-esp and not forks #513 --- .github/workflows/sonar_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sonar_check.yml b/.github/workflows/sonar_check.yml index 18dea5b40..9d983fc09 100644 --- a/.github/workflows/sonar_check.yml +++ b/.github/workflows/sonar_check.yml @@ -11,6 +11,7 @@ on: jobs: build: name: Build and analyze + if: github.repository == 'emsesp/EMS-ESP32' runs-on: ubuntu-latest env: BUILD_WRAPPER_OUT_DIR: bw-output From cdac298d3818eda8a1d4d5207cd0b23dc80cabcc Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 4 Jul 2024 21:55:18 +0200 Subject: [PATCH 2/3] update test data --- test/standalone_file_export/emsesp_customizations.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/standalone_file_export/emsesp_customizations.json b/test/standalone_file_export/emsesp_customizations.json index 1880d6513..34523dfc7 100644 --- a/test/standalone_file_export/emsesp_customizations.json +++ b/test/standalone_file_export/emsesp_customizations.json @@ -3,12 +3,12 @@ "Customizations": { "ts": [ { - "id": "01-0203-0405-0607", + "id": "01_0203_0405_0607", "name": "test_sensor1", "offset": 0 }, { - "id": "0B-0C0D-0E0F-1011", + "id": "0B_0C0D_0E0F_1011", "name": "test_sensor2", "offset": 4 } @@ -18,6 +18,7 @@ { "product_id": 123, "device_id": 8, + "custom_name": "Trendline", "entity_ids": [ "08heatingactive|is my heating on?" ] From 6feae50ecddb433a1f5a637d7aa5dcd942805874 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 4 Jul 2024 21:55:35 +0200 Subject: [PATCH 3/3] test data with more - to _ replacements for sensor IDs --- src/temperaturesensor.cpp | 2 +- src/web/WebCustomizationService.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/temperaturesensor.cpp b/src/temperaturesensor.cpp index 7766b465c..c5ae4ddfd 100644 --- a/src/temperaturesensor.cpp +++ b/src/temperaturesensor.cpp @@ -625,7 +625,7 @@ bool TemperatureSensor::Sensor::apply_customization() { #if defined(EMSESP_TEST) void TemperatureSensor::test() { // add 2 temperature sensors - // Sensor ID: 01-0203-0405-0607 + // Sensor ID: 01_0203_0405_0607 uint8_t addr[ADDR_LEN] = {1, 2, 3, 4, 5, 6, 7, 8}; sensors_.emplace_back(addr); sensors_.back().apply_customization(); diff --git a/src/web/WebCustomizationService.cpp b/src/web/WebCustomizationService.cpp index afefbb992..0b0dd5e1e 100644 --- a/src/web/WebCustomizationService.cpp +++ b/src/web/WebCustomizationService.cpp @@ -103,7 +103,7 @@ StateUpdateResult WebCustomization::update(JsonObject root, WebCustomization & c sensor.name = ""; // no need to store id as name } std::replace(sensor.id.begin(), sensor.id.end(), '-', '_'); // change old ids to v3.7 style - customizations.sensorCustomizations.push_back(sensor); // add to list + customizations.sensorCustomizations.push_back(sensor); // add to list } } @@ -377,13 +377,13 @@ void WebCustomizationService::test() { // Temperature sensors webCustomization.sensorCustomizations.clear(); auto sensor = SensorCustomization(); - sensor.id = "01-0203-0405-0607"; + sensor.id = "01_0203_0405_0607"; sensor.name = "test_sensor1"; sensor.offset = 0; webCustomization.sensorCustomizations.push_back(sensor); auto sensor2 = SensorCustomization(); - sensor2.id = "0B-0C0D-0E0F-1011"; + sensor2.id = "0B_0C0D_0E0F_1011"; sensor2.name = "test_sensor2"; sensor2.offset = 4; webCustomization.sensorCustomizations.push_back(sensor2);