mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
pass cmd string as reference
This commit is contained in:
@@ -489,7 +489,7 @@ bool EMSdevice::is_readable(const void * value_p) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if value/command is readonly
|
// check if value/command is readonly
|
||||||
bool EMSdevice::is_readonly(const std::string cmd, const int8_t id) const {
|
bool EMSdevice::is_readonly(const std::string & cmd, const int8_t id) const {
|
||||||
uint8_t tag = id > 0 ? DeviceValueTAG::TAG_HC1 + id - 1 : DeviceValueTAG::TAG_NONE;
|
uint8_t tag = id > 0 ? DeviceValueTAG::TAG_HC1 + id - 1 : DeviceValueTAG::TAG_NONE;
|
||||||
for (const auto & dv : devicevalues_) {
|
for (const auto & dv : devicevalues_) {
|
||||||
// check command name and tag, id -1 is default hc and only checks name
|
// check command name and tag, id -1 is default hc and only checks name
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ class EMSdevice {
|
|||||||
void read_command(const uint16_t type_id, uint8_t offset = 0, uint8_t length = 0) const;
|
void read_command(const uint16_t type_id, uint8_t offset = 0, uint8_t length = 0) const;
|
||||||
|
|
||||||
bool is_readable(const void * value_p) const;
|
bool is_readable(const void * value_p) const;
|
||||||
bool is_readonly(const std::string cmd, const int8_t id) const;
|
bool is_readonly(const std::string & cmd, const int8_t id) const;
|
||||||
bool has_command(const void * value_p) const;
|
bool has_command(const void * value_p) const;
|
||||||
void publish_value(void * value_p) const;
|
void publish_value(void * value_p) const;
|
||||||
void publish_all_values();
|
void publish_all_values();
|
||||||
|
|||||||
Reference in New Issue
Block a user