From b7d6d0dda3936a2b2e9515a09f3fede79e2d3bfe Mon Sep 17 00:00:00 2001 From: Geoff Davis Date: Wed, 18 Mar 2020 07:29:30 -0700 Subject: [PATCH] Use callbacks, update more frequenly. Callbacks appear to be working now that variables are initialized in the HeatPump library. With callbacks enabled, we can poll more often. --- espmhp.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/espmhp.h b/espmhp.h index 7d548ae..a6931bb 100644 --- a/espmhp.h +++ b/espmhp.h @@ -12,8 +12,7 @@ * - ESPHome 1.15.0-dev or greater */ -// Uncomment to use HeatPump callback functions (broken, causes boot failures) -//#define USE_CALLBACKS +#define USE_CALLBACKS #include "esphome.h" #include "HeatPump.h" @@ -28,7 +27,7 @@ static const char* ESPMHP_VERSION = "1.0.2"; /* If polling interval is greater than 9 seconds, the HeatPump library reconnects, but doesn't then follow up with our data request.*/ -static const uint32_t ESPMHP_POLL_INTERVAL_DEFAULT = 2000; // in milliseconds, +static const uint32_t ESPMHP_POLL_INTERVAL_DEFAULT = 500; // in milliseconds, // 0 < X <= 9000 static const uint8_t ESPMHP_MIN_TEMPERATURE = 16; // degrees C, // defined by hardware