mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-14 05:36:34 +03:00
add back 4wayValve as bool, #2844
This commit is contained in:
@@ -67,5 +67,5 @@
|
|||||||
"vite-plugin-imagemin": "^0.6.1",
|
"vite-plugin-imagemin": "^0.6.1",
|
||||||
"vite-tsconfig-paths": "^6.1.0"
|
"vite-tsconfig-paths": "^6.1.0"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.29.1"
|
"packageManager": "pnpm@10.29.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -647,6 +647,7 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
|
|||||||
DeviceValueUOM::DEGREES,
|
DeviceValueUOM::DEGREES,
|
||||||
MAKE_CF_CB(set_pool_temp));
|
MAKE_CF_CB(set_pool_temp));
|
||||||
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::ENUM, FL_(enum_4way), FL_(hp4wayValve), DeviceValueUOM::NONE);
|
// register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::ENUM, FL_(enum_4way), FL_(hp4wayValve), DeviceValueUOM::NONE);
|
||||||
|
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hp4wayValve_, DeviceValueType::BOOL, FL_(hp4wayValve), DeviceValueUOM::NONE);
|
||||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE);
|
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &hpInput[0].state, DeviceValueType::BOOL, FL_(hpInput1), DeviceValueUOM::NONE);
|
||||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||||
&hpInput[0].option,
|
&hpInput[0].option,
|
||||||
@@ -1731,7 +1732,9 @@ void Boiler::process_HpPower(std::shared_ptr<const Telegram> telegram) {
|
|||||||
has_bitupdate(telegram, hp3wayValve_, 0, 6);
|
has_bitupdate(telegram, hp3wayValve_, 0, 6);
|
||||||
// has_bitupdate(telegram, heating_, 0, 0); // heating on? https://github.com/emsesp/EMS-ESP32/discussions/1898
|
// has_bitupdate(telegram, heating_, 0, 0); // heating on? https://github.com/emsesp/EMS-ESP32/discussions/1898
|
||||||
has_bitupdate(telegram, hpSwitchValve_, 0, 4);
|
has_bitupdate(telegram, hpSwitchValve_, 0, 4);
|
||||||
|
if (coolingType_ == 3) {
|
||||||
|
has_bitupdate(telegram, hp4wayValve_, 0, 3); // https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3869770845
|
||||||
|
}
|
||||||
has_bitupdate(telegram, elHeatStep1_, 3, 0);
|
has_bitupdate(telegram, elHeatStep1_, 3, 0);
|
||||||
has_bitupdate(telegram, elHeatStep2_, 3, 1);
|
has_bitupdate(telegram, elHeatStep2_, 3, 1);
|
||||||
has_bitupdate(telegram, elHeatStep3_, 3, 2);
|
has_bitupdate(telegram, elHeatStep3_, 3, 2);
|
||||||
@@ -1831,6 +1834,8 @@ void Boiler::process_HpInConfig(std::shared_ptr<const Telegram> telegram) {
|
|||||||
|
|
||||||
// Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0485)
|
// Boiler(0x08) -W-> Me(0x0B), HpHeaterConfig(0x0485)
|
||||||
void Boiler::process_HpCooling(std::shared_ptr<const Telegram> telegram) {
|
void Boiler::process_HpCooling(std::shared_ptr<const Telegram> telegram) {
|
||||||
|
// coolingtype to set 4wayvalve (0x48D), type not published yet, https://github.com/emsesp/EMS-ESP32/issues/2844#issuecomment-3869770845
|
||||||
|
has_update(telegram, coolingType_, 0); // none = 0, passive cooling box = 1, active cooling box = 2, 4-way valve = 3, active and passive cooling box = 4.
|
||||||
has_update(telegram, pvCooling_, 21);
|
has_update(telegram, pvCooling_, 21);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -270,6 +270,7 @@ class Boiler : public EMSdevice {
|
|||||||
uint8_t powerReduction_;
|
uint8_t powerReduction_;
|
||||||
|
|
||||||
uint8_t pvCooling_;
|
uint8_t pvCooling_;
|
||||||
|
uint8_t coolingType_;
|
||||||
uint8_t auxHeatMode_;
|
uint8_t auxHeatMode_;
|
||||||
uint8_t auxMaxLimit_;
|
uint8_t auxMaxLimit_;
|
||||||
uint8_t auxLimitStart_;
|
uint8_t auxLimitStart_;
|
||||||
|
|||||||
@@ -137,8 +137,6 @@ StateUpdateResult WebCustomEntity::update(JsonObject root, WebCustomEntity & web
|
|||||||
snprintf(key, sizeof(key), "c:%s", entityItem.name);
|
snprintf(key, sizeof(key), "c:%s", entityItem.name);
|
||||||
if (EMSESP::nvs_.isKey(key)) {
|
if (EMSESP::nvs_.isKey(key)) {
|
||||||
entityItem.data = EMSESP::nvs_.getString(key).c_str();
|
entityItem.data = EMSESP::nvs_.getString(key).c_str();
|
||||||
} else {
|
|
||||||
EMSESP::nvs_.putString(key, entityItem.data.c_str());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
webCustomEntity.customEntityItems.push_back(entityItem); // add to list
|
webCustomEntity.customEntityItems.push_back(entityItem); // add to list
|
||||||
@@ -174,13 +172,16 @@ bool WebCustomEntityService::command_setvalue(const char * value, const int8_t i
|
|||||||
|
|
||||||
for (CustomEntityItem & entityItem : *customEntityItems_) {
|
for (CustomEntityItem & entityItem : *customEntityItems_) {
|
||||||
if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) {
|
if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) {
|
||||||
|
if (entityItem.data == value) {
|
||||||
|
return true; // no change
|
||||||
|
}
|
||||||
if (entityItem.ram == 1) {
|
if (entityItem.ram == 1) {
|
||||||
entityItem.data = value;
|
entityItem.data = value;
|
||||||
} else if (entityItem.ram == 2) { // NVS
|
} else if (entityItem.ram == 2) { // NVS
|
||||||
entityItem.data = value;
|
entityItem.data = value;
|
||||||
char key[sizeof(entityItem.name) + 2];
|
char key[sizeof(entityItem.name) + 2];
|
||||||
snprintf(key, sizeof(key), "c:%s", entityItem.name);
|
snprintf(key, sizeof(key), "c:%s", entityItem.name);
|
||||||
if (EMSESP::nvs_.getString(key) != entityItem.data.c_str()) {
|
if (!EMSESP::nvs_.isKey(key) || EMSESP::nvs_.getString(key) != entityItem.data.c_str()) {
|
||||||
EMSESP::nvs_.putString(key, entityItem.data.c_str());
|
EMSESP::nvs_.putString(key, entityItem.data.c_str());
|
||||||
}
|
}
|
||||||
} else if (entityItem.value_type == DeviceValueType::STRING) {
|
} else if (entityItem.value_type == DeviceValueType::STRING) {
|
||||||
|
|||||||
Reference in New Issue
Block a user