add const

This commit is contained in:
proddy
2026-05-16 15:45:14 +02:00
parent a1f24b38fa
commit 85a12bf581
35 changed files with 384 additions and 370 deletions

View File

@@ -705,7 +705,7 @@ void WebCustomEntityService::fetch() {
}
// called on process telegram, read from telegram
bool WebCustomEntityService::get_value(std::shared_ptr<const Telegram> telegram) {
bool WebCustomEntityService::get_value(const std::shared_ptr<const Telegram> & telegram) {
bool has_change = false;
// read-length of BOOL, INT8, UINT8, INT16, UINT16, UINT24, TIME, UINT32
const uint8_t len[] = {1, 1, 1, 2, 2, 3, 3, 4};

View File

@@ -62,7 +62,7 @@ class WebCustomEntityService : public StatefulService<WebCustomEntity> {
bool command_setvalue(const char * value, const int8_t id, const char * name);
bool get_value_info(JsonObject output, const char * cmd);
void get_value_json(JsonObject output, CustomEntityItem const & entity);
bool get_value(std::shared_ptr<const Telegram> telegram);
bool get_value(const std::shared_ptr<const Telegram> & telegram);
void fetch();
void render_value(JsonObject output, CustomEntityItem const & entity, const bool useVal = false, const bool web = false, const bool add_uom = false);
void show_values(JsonObject output);

View File

@@ -70,7 +70,7 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
obj["id"] = emsdevice->unique_id(); // a unique id
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
obj["t"] = emsdevice->device_type(); // device type number
obj["b"] = emsdevice->brand_to_char(); // brand
obj["b"] = emsdevice->brand_to_cstr(); // brand
obj["n"] = emsdevice->name(); // custom name
obj["d"] = emsdevice->device_id(); // deviceid
obj["p"] = emsdevice->product_id(); // productid