From 4aa7d2a74c7a51efd1025951ae1820e3b155e52e Mon Sep 17 00:00:00 2001 From: Aruna Tennakoon Date: Wed, 2 Apr 2025 08:46:31 +0700 Subject: [PATCH] fix: factor --- changelog.md | 4 ++++ library.json | 2 +- library.properties | 2 +- src/Capabilities/PowerSensor.h | 2 +- src/SinricProVersion.h | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index fb09ad30..be11d20d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## Version 3.5.1 + Fixed: + - Fix: sendPowerSensorEvent sets factor even when specified. + ## Version 3.5.0 New: - Support Start/Stop and Open/Close capabilities. diff --git a/library.json b/library.json index e09adc5b..5785d4ba 100644 --- a/library.json +++ b/library.json @@ -18,7 +18,7 @@ } ], "homepage": "https://sinric.pro", - "version": "3.5.0", + "version": "3.5.1", "frameworks": "arduino", "platforms": ["espressif8266", "espressif32", "raspberrypi"], "dependencies": [ diff --git a/library.properties b/library.properties index 6e91728a..d3cff445 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SinricPro -version=3.5.0 +version=3.5.1 author=Boris Jaeger maintainer=Boris Jaeger sentence=Library for https://sinric.pro - simple way to connect your device to alexa diff --git a/src/Capabilities/PowerSensor.h b/src/Capabilities/PowerSensor.h index f81057fa..5f1bc94d 100644 --- a/src/Capabilities/PowerSensor.h +++ b/src/Capabilities/PowerSensor.h @@ -59,7 +59,7 @@ bool PowerSensor::sendPowerSensorEvent(float voltage, float current, float po JsonObject event_value = eventMessage[FSTR_SINRICPRO_payload][FSTR_SINRICPRO_value]; if (power == -1) power = voltage * current; - if (apparentPower != -1) + if (factor == -1 && apparentPower != -1) factor = power / apparentPower; unsigned long currentTimestamp = device->getTimestamp(); diff --git a/src/SinricProVersion.h b/src/SinricProVersion.h index 6659c3e8..7f6b1d0a 100644 --- a/src/SinricProVersion.h +++ b/src/SinricProVersion.h @@ -6,7 +6,7 @@ // Version Configuration #define SINRICPRO_VERSION_MAJOR 3 #define SINRICPRO_VERSION_MINOR 5 -#define SINRICPRO_VERSION_REVISION 0 +#define SINRICPRO_VERSION_REVISION 1 #define SINRICPRO_VERSION STR(SINRICPRO_VERSION_MAJOR) "." STR(SINRICPRO_VERSION_MINOR) "." STR(SINRICPRO_VERSION_REVISION) #define SINRICPRO_VERSION_STR "SinricPro (v" SINRICPRO_VERSION ")" #define SINRICPRO_VERISON_INT SINRICPRO_VERSION_MAJOR * 1000000 + SINRICPRO_VERSION_MINOR * 1000 + SINRICPRO_VERSION_REVISION \ No newline at end of file