mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-06-14 03:46:49 +03:00
add const
This commit is contained in:
@@ -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};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user