From f0f40bbcac70a79f66150b888cee26e6bd87566b Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 13 Oct 2025 08:39:10 +0200 Subject: [PATCH] fix src commands, icon --- src/core/command.cpp | 10 +++++----- src/core/emsdevice.cpp | 2 +- src/core/locale_translations.h | 24 ++++++++++++------------ src/devices/connect.cpp | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/core/command.cpp b/src/core/command.cpp index 22876611f..ad4cc1fe6 100644 --- a/src/core/command.cpp +++ b/src/core/command.cpp @@ -271,12 +271,12 @@ const char * Command::parse_command_string(const char * command, int8_t & id) { } else if (!strncmp(lowerCmd, "hs", 2) && command[2] >= '1' && command[2] <= '9') { id = command[2] - '1' + DeviceValueTAG::TAG_HS1; //20; command += 3; - } else if (!strncmp(lowerCmd, "src", 3) && command[2] == '1' && command[3] >= '0' && command[3] <= '6') { - id = command[3] - '0' + DeviceValueTAG::TAG_SRC10; //46; + } else if (!strncmp(lowerCmd, "src", 3) && command[3] == '1' && command[4] >= '0' && command[4] <= '6') { + id = command[4] - '0' + DeviceValueTAG::TAG_SRC10; //46; + command += 5; + } else if (!strncmp(lowerCmd, "src", 3) && command[3] >= '1' && command[3] <= '9') { + id = command[3] - '1' + DeviceValueTAG::TAG_SRC1; //36; command += 4; - } else if (!strncmp(lowerCmd, "src", 3) && command[2] >= '1' && command[2] <= '9') { - id = command[2] - '1' + DeviceValueTAG::TAG_SRC1; //36; - command += 3; } else if (!strncmp(lowerCmd, "dhw", 3)) { // no number id = DeviceValueTAG::TAG_DHW1; command += 3; diff --git a/src/core/emsdevice.cpp b/src/core/emsdevice.cpp index 1ff7452a9..f8b3e703e 100644 --- a/src/core/emsdevice.cpp +++ b/src/core/emsdevice.cpp @@ -1902,7 +1902,7 @@ void EMSdevice::mqtt_ha_entity_config_create() { count++; } // SRC thermostats mapped to connect/src1/... - if (dv.tag >= DeviceValueTAG::TAG_SRC1 && !strcmp(dv.short_name, FL_(roomtemp)[0])) { + if (dv.tag >= DeviceValueTAG::TAG_SRC1 && dv.tag <= DeviceValueTAG::TAG_SRC16 && !strcmp(dv.short_name, FL_(roomtemp)[0])) { Mqtt::publish_ha_climate_config(dv.tag, true, false, dv.min, dv.max); } diff --git a/src/core/locale_translations.h b/src/core/locale_translations.h index e260431f4..df326cc0f 100644 --- a/src/core/locale_translations.h +++ b/src/core/locale_translations.h @@ -337,18 +337,18 @@ MAKE_WORD_TRANSLATION(partymode, "party", "Party", "party", "party", "impreza", MAKE_WORD_TRANSLATION(fireplace, "fireplace", "Kamin", "haard", "Kamin", "kominek", "", "", "şömine", "camino", "krb", "") // TODO translate // SRC plus -MAKE_WORD_TRANSLATION(chefhat, "mdi:chef-hat") -MAKE_WORD_TRANSLATION(sofasingle, "mdi:sofa-single-outline") -MAKE_WORD_TRANSLATION(bowlmix, "mdi:bowl-mix-outline") -MAKE_WORD_TRANSLATION(bedsingle, "mdi:bed-single-outline") -MAKE_WORD_TRANSLATION(beddouble, "mdi:bed-double-outline") -MAKE_WORD_TRANSLATION(teddybear, "mdi:teddy-bear") -MAKE_WORD_TRANSLATION(shower, "mdi:shower") -MAKE_WORD_TRANSLATION(laptop, "mdi:laptop") -MAKE_WORD_TRANSLATION(door, "mdi:door") -MAKE_WORD_TRANSLATION(palette, "mdi:palette-outline") -MAKE_WORD_TRANSLATION(washingmachine, "mdi:washing-machine") -MAKE_WORD_TRANSLATION(bookshelf, "mdi:bookshelf") +MAKE_WORD_TRANSLATION(chefhat, "mdi:chef-hat", "mdi:chef-hat") +MAKE_WORD_TRANSLATION(sofasingle, "mdi:sofa-single-outline", "mdi:sofa-single-outline") +MAKE_WORD_TRANSLATION(bowlmix, "mdi:bowl-mix-outline", "mdi:bowl-mix-outline") +MAKE_WORD_TRANSLATION(bedsingle, "mdi:bed-single-outline", "mdi:bed-single-outline") +MAKE_WORD_TRANSLATION(beddouble, "mdi:bed-double-outline", "mdi:bed-double-outline") +MAKE_WORD_TRANSLATION(teddybear, "mdi:teddy-bear", "mdi:teddy-bear") +MAKE_WORD_TRANSLATION(shower, "mdi:shower", "mdi:shower") +MAKE_WORD_TRANSLATION(laptop, "mdi:laptop", "mdi:laptop") +MAKE_WORD_TRANSLATION(door, "mdi:door", "mdi:door") +MAKE_WORD_TRANSLATION(palette, "mdi:palette-outline", "mdi:palette-outline") +MAKE_WORD_TRANSLATION(washingmachine, "mdi:washing-machine", "mdi:washing-machine") +MAKE_WORD_TRANSLATION(bookshelf, "mdi:bookshelf", "mdi:bookshelf") // MQTT Discovery - this is special device entity for 'climate' MAKE_TRANSLATION(haclimate, "haclimate", "mqtt discovery current room temperature", "Discovery aktuelle Raumtemperatur", "Discovery huidige kamertemperatuur", "MQTT Discovery för aktuell rumstemperatur", "termostat w HA", "HA Avlest temp", "", "Güncel osa sıcaklığı", "verifica temperatura ambiente attuale", "mqtt discovery aktuálna teplota v miestnosti", "mqtt discovery aktuální pokojová teplota") // TODO translate diff --git a/src/devices/connect.cpp b/src/devices/connect.cpp index f9db117a7..268b24558 100644 --- a/src/devices/connect.cpp +++ b/src/devices/connect.cpp @@ -90,7 +90,7 @@ void Connect::register_device_values_room(std::shared_ptr register_device_value(tag, &room->mode_, DeviceValueType::ENUM, FL_(enum_mode8), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode)); register_device_value(tag, &room->name_, DeviceValueType::STRING, FL_(name), DeviceValueUOM::NONE, MAKE_CF_CB(set_name)); register_device_value(tag, &room->childlock_, DeviceValueType::BOOL, FL_(childlock), DeviceValueUOM::NONE, MAKE_CF_CB(set_childlock)); - register_device_value(tag, &room->icon_, DeviceValueType::ENUM, FL_(enum_icons), FL_(icon), DeviceValueUOM::NONE, MAKE_CF_CB(set_icon), 0, 12); + register_device_value(tag, &room->icon_, DeviceValueType::ENUM, FL_(enum_icons), FL_(icon), DeviceValueUOM::NONE, MAKE_CF_CB(set_icon)); } std::shared_ptr Connect::room_circuit(const uint8_t num, const bool create) { @@ -142,7 +142,7 @@ void Connect::process_roomThermostatName(std::shared_ptr telegra if (rc == nullptr) { return; } - has_update(rc->icon_, 0); + has_update(telegram, rc->icon_, 0); for (uint8_t i = telegram->offset; i < telegram->message_length + telegram->offset && i < 100; i++) { if ((i > 1) && (i % 2) == 0) { rc->name_[(i - 2) / 2] = telegram->message_data[i - telegram->offset];