mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-27 00:59:10 +03:00
autoformatting, check HS circuits
This commit is contained in:
@@ -293,7 +293,7 @@ bool EMSdevice::is_fetch(uint16_t telegram_id) {
|
||||
bool EMSdevice::has_tag(const uint8_t tag) {
|
||||
for (const auto & dv : devicevalues_) {
|
||||
if (dv.tag == tag && tag >= DeviceValueTAG::TAG_HC1) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -505,7 +505,7 @@ void EMSdevice::register_device_value(uint8_t tag,
|
||||
flags |= CommandFlag::MQTT_SUB_FLAG_HC;
|
||||
} else if (tag >= DeviceValueTAG::TAG_WWC1 && tag <= DeviceValueTAG::TAG_WWC4) {
|
||||
flags |= CommandFlag::MQTT_SUB_FLAG_WWC;
|
||||
} else if (tag == DeviceValueTAG::TAG_DEVICE_DATA_WW) {
|
||||
} else if (tag == DeviceValueTAG::TAG_DEVICE_DATA_WW || tag == DeviceValueTAG::TAG_BOILER_DATA_WW) {
|
||||
flags |= CommandFlag::MQTT_SUB_FLAG_WW;
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ void EMSdevice::publish_value(void * value_p) {
|
||||
if (dv.value_p == value_p && dv.has_state(DeviceValueState::DV_VISIBLE)) {
|
||||
char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];
|
||||
if (Mqtt::publish_single2cmd()) {
|
||||
if ((dv.tag >= DeviceValueTAG::TAG_HC1 && dv.tag <= DeviceValueTAG::TAG_WWC4)) {
|
||||
if (dv.tag >= DeviceValueTAG::TAG_HC1) {
|
||||
snprintf(topic,
|
||||
sizeof(topic),
|
||||
"%s/%s/%s",
|
||||
@@ -903,11 +903,9 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8
|
||||
JsonObject json = output;
|
||||
int8_t tag = id;
|
||||
|
||||
// check if we have hc or wwc
|
||||
if (id >= 1 && id <= 8) {
|
||||
// check if we have hc or wwc or hs
|
||||
if (id >= 1 && id <= 29) {
|
||||
tag = DeviceValueTAG::TAG_HC1 + id - 1;
|
||||
} else if (id >= 9 && id <= 12) {
|
||||
tag = DeviceValueTAG::TAG_WWC1 + id - 9;
|
||||
} else if (id != -1) {
|
||||
return false; // error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user