fix src commands, icon

This commit is contained in:
MichaelDvP
2025-10-13 08:39:10 +02:00
parent 036e2917a5
commit f0f40bbcac
4 changed files with 20 additions and 20 deletions

View File

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

View File

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

View File

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

View File

@@ -90,7 +90,7 @@ void Connect::register_device_values_room(std::shared_ptr<Connect::RoomCircuit>
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::RoomCircuit> Connect::room_circuit(const uint8_t num, const bool create) {
@@ -142,7 +142,7 @@ void Connect::process_roomThermostatName(std::shared_ptr<const Telegram> 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];