mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
don't show commands in web or console
This commit is contained in:
@@ -422,12 +422,12 @@ void EMSdevice::show_mqtt_handlers(uuid::console::Shell & shell) {
|
||||
Mqtt::show_topic_handlers(shell, device_type_);
|
||||
}
|
||||
|
||||
void EMSdevice::register_mqtt_topic(const std::string & topic, mqtt_subfunction_p f) {
|
||||
void EMSdevice::register_mqtt_topic(const std::string & topic, const mqtt_sub_function_p f) {
|
||||
Mqtt::subscribe(device_type_, topic, f);
|
||||
}
|
||||
|
||||
// register a callback function for a specific telegram type
|
||||
void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, process_function_p f) {
|
||||
void EMSdevice::register_telegram_type(const uint16_t telegram_type_id, const __FlashStringHelper * telegram_type_name, bool fetch, const process_function_p f) {
|
||||
telegram_functions_.emplace_back(telegram_type_id, telegram_type_name, fetch, f);
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ void EMSdevice::register_device_value(uint8_t tag,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom,
|
||||
cmdfunction_p f,
|
||||
const cmd_function_p f,
|
||||
int32_t min,
|
||||
uint32_t max) {
|
||||
register_device_value(tag, value_p, type, options, name[0], name[1], uom, (f != nullptr), min, max);
|
||||
@@ -513,7 +513,7 @@ void EMSdevice::register_device_value(uint8_t tag,
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom,
|
||||
cmdfunction_p f) {
|
||||
const cmd_function_p f) {
|
||||
register_device_value(tag, value_p, type, options, name, uom, f, 0, 0);
|
||||
}
|
||||
|
||||
@@ -562,8 +562,8 @@ void EMSdevice::generate_values_json_web(JsonObject & json) {
|
||||
JsonArray data = json.createNestedArray("data");
|
||||
|
||||
for (const auto & dv : devicevalues_) {
|
||||
// ignore if full_name empty
|
||||
if (dv.full_name != nullptr) {
|
||||
// ignore if full_name empty and also commands
|
||||
if ((dv.full_name != nullptr) && (dv.type != DeviceValueType::CMD)) {
|
||||
JsonObject obj; // create the object, if needed
|
||||
|
||||
// handle Booleans (true, false)
|
||||
@@ -586,11 +586,11 @@ void EMSdevice::generate_values_json_web(JsonObject & json) {
|
||||
}
|
||||
}
|
||||
|
||||
// handle commands without value
|
||||
else if (dv.type == DeviceValueType::CMD) {
|
||||
obj = data.createNestedObject();
|
||||
obj["v"] = "";
|
||||
}
|
||||
// // handle commands without value
|
||||
// else if (dv.type == DeviceValueType::CMD) {
|
||||
// obj = data.createNestedObject();
|
||||
// obj["v"] = "";
|
||||
// }
|
||||
|
||||
else {
|
||||
// handle Integers and Floats
|
||||
|
||||
Reference in New Issue
Block a user