From 77a8857e2fcbe23bffd80eaea47ee18755b42b47 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 26 May 2022 12:42:38 +0200 Subject: [PATCH] fix #522, device-flag for IVT controller --- src/device_library.h | 2 +- src/devices/controller.cpp | 6 ++++-- src/emsdevice.h | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/device_library.h b/src/device_library.h index 21fd47917..acbbc514c 100644 --- a/src/device_library.h +++ b/src/device_library.h @@ -68,7 +68,7 @@ {224, DeviceType::CONTROLLER, F("9000i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09 {229, DeviceType::CONTROLLER, F("8700i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09 {230, DeviceType::CONTROLLER, F("BC Base"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09 -{240, DeviceType::CONTROLLER, F("Rego 3000"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09 +{240, DeviceType::CONTROLLER, F("Rego 3000"), DeviceFlags::EMS_DEVICE_FLAG_IVT}, // 0x09 {241, DeviceType::CONTROLLER, F("Condens 5000i"), DeviceFlags::EMS_DEVICE_FLAG_NONE}, // 0x09 // Thermostat - not currently supporting write operations, like the Easy/100 types - 0x18 diff --git a/src/devices/controller.cpp b/src/devices/controller.cpp index f7b0b952f..a60912629 100644 --- a/src/devices/controller.cpp +++ b/src/devices/controller.cpp @@ -25,8 +25,10 @@ REGISTER_FACTORY(Controller, EMSdevice::DeviceType::CONTROLLER); Controller::Controller(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const std::string & name, uint8_t flags, uint8_t brand) : EMSdevice(device_type, device_id, product_id, version, name, flags, brand) { // IVT broadcasts Thermostat time from controller (0x09) if display is off. - register_telegram_type(0x06, F("RCTime"), false, MAKE_PF_CB(process_dateTime)); - register_device_value(DeviceValueTAG::TAG_NONE, &dateTime_, DeviceValueType::STRING, nullptr, FL_(dateTime), DeviceValueUOM::NONE); + if ((flags & 0x0F) == EMS_DEVICE_FLAG_IVT) { + register_telegram_type(0x06, F("RCTime"), false, MAKE_PF_CB(process_dateTime)); + register_device_value(DeviceValueTAG::TAG_NONE, &dateTime_, DeviceValueType::STRING, nullptr, FL_(dateTime), DeviceValueUOM::NONE); + } } // process_dateTime - type 0x06 - date and time from a thermostat - 14 bytes long, IVT only diff --git a/src/emsdevice.h b/src/emsdevice.h index 3da12a4e3..567cfd8f8 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -315,6 +315,9 @@ class EMSdevice { // device flags: The lower 4 bits hold the unique identifier, the upper 4 bits are used for specific flags static constexpr uint8_t EMS_DEVICE_FLAG_NONE = 0; + // Controller + static constexpr uint8_t EMS_DEVICE_FLAG_IVT = 1; + // Boiler static constexpr uint8_t EMS_DEVICE_FLAG_EMS = 1; static constexpr uint8_t EMS_DEVICE_FLAG_EMSPLUS = 2;