show sensor command commands

This commit is contained in:
MichaelDvP
2024-01-30 08:05:50 +01:00
parent 0f799d5922
commit de9c224a23
3 changed files with 16 additions and 18 deletions

View File

@@ -345,6 +345,11 @@ bool TemperatureSensor::updated_values() {
// called from emsesp.cpp for commands
bool TemperatureSensor::get_value_info(JsonObject output, const char * cmd, const int8_t id) {
// check of it a 'commmands' command
if (Helpers::toLower(cmd) == F_(commands)) {
return Command::list(EMSdevice::DeviceType::TEMPERATURESENSOR, output);
}
if (sensors_.empty()) {
return true; // no sensors, return true
}
@@ -372,11 +377,6 @@ bool TemperatureSensor::get_value_info(JsonObject output, const char * cmd, cons
return true;
}
// check of it a 'commmands' command
if (Helpers::toLower(cmd) == F_(commands)) {
return Command::list(EMSdevice::DeviceType::TEMPERATURESENSOR, output);
}
// this is for a specific sensor
// make a copy of the string command for parsing, and lowercase it
char sensor_name[30] = {'\0'};