autoformatting, check HS circuits

This commit is contained in:
MichaelDvP
2022-03-02 13:25:35 +01:00
parent 7168f6c75e
commit 6bbe2687ef
6 changed files with 78 additions and 67 deletions

View File

@@ -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
}