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

@@ -623,6 +623,11 @@ void AnalogSensor::publish_values(const bool force) {
// called from emsesp.cpp for commands
// searches sensor by name
bool AnalogSensor::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::ANALOGSENSOR, output);
}
if (sensors_.empty()) {
return true; // no sensors, return true
}
@@ -647,11 +652,6 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
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'};