1806 mqtt_publish_str(unit->alias, (char *)"mode", (char *)UNITMODE[unit->mode]); |
1806 mqtt_publish_str(unit->alias, (char *)"mode", (char *)UNITMODE[unit->mode]); |
1807 } |
1807 } |
1808 if (unit->mqtt_flag & MQTT_FLAG_PROFILE) { |
1808 if (unit->mqtt_flag & MQTT_FLAG_PROFILE) { |
1809 mqtt_publish_str(unit->alias, (char *)"profile/uuid", unit->profile); |
1809 mqtt_publish_str(unit->alias, (char *)"profile/uuid", unit->profile); |
1810 mqtt_publish_str(unit->alias, (char *)"profile/state", (char *)PROFSTATE[unit->prof_state]); |
1810 mqtt_publish_str(unit->alias, (char *)"profile/state", (char *)PROFSTATE[unit->prof_state]); |
|
1811 for (profile = Config.profiles; profile; profile = profile->next) { |
|
1812 if (strcmp(unit->profile, profile->uuid) == 0) { |
|
1813 mqtt_publish_str(unit->alias, (char *)"profile/name", profile->name); |
|
1814 mqtt_publish_int(unit->alias, (char *)"profile/fridgemode", profile->fridge_mode); |
|
1815 } |
|
1816 } |
1811 } |
1817 } |
1812 if (unit->mqtt_flag & MQTT_FLAG_PERCENT) { |
1818 if (unit->mqtt_flag & MQTT_FLAG_PERCENT) { |
1813 mqtt_publish_int(unit->alias, (char *)"profile/percent", unit->prof_percent); |
1819 mqtt_publish_int(unit->alias, (char *)"profile/percent", unit->prof_percent); |
1814 } |
1820 } |
1815 unit->mqtt_flag = 0; |
1821 unit->mqtt_flag = 0; |