mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
commands take a set of flags, like NEED_ADMIN or HIDDEN
This commit is contained in:
@@ -120,9 +120,6 @@ enum DeviceValueTAG : uint8_t {
|
||||
|
||||
};
|
||||
|
||||
// mqtt flags for command subscriptions
|
||||
enum MqttSubFlag : uint8_t { FLAG_NORMAL = 0, FLAG_HC, FLAG_WWC, FLAG_NOSUB };
|
||||
|
||||
// mqtt-HA flags
|
||||
enum DeviceValueHA : uint8_t { HA_NONE = 0, HA_VALUE, HA_DONE };
|
||||
|
||||
@@ -170,6 +167,7 @@ class EMSdevice {
|
||||
return ((device_id & 0x7F) == (device_id_ & 0x7F));
|
||||
}
|
||||
|
||||
// flags
|
||||
inline void add_flags(uint8_t flags) {
|
||||
flags_ |= flags;
|
||||
}
|
||||
@@ -281,15 +279,14 @@ class EMSdevice {
|
||||
const __FlashStringHelper * const * options,
|
||||
const __FlashStringHelper * const * name,
|
||||
uint8_t uom);
|
||||
// void register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * options, const __FlashStringHelper * const * name, uint8_t uom, int32_t min, uint32_t max);
|
||||
|
||||
void write_command(const uint16_t type_id, const uint8_t offset, uint8_t * message_data, const uint8_t message_length, const uint16_t validate_typeid);
|
||||
void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid);
|
||||
void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value);
|
||||
|
||||
void read_command(const uint16_t type_id, uint8_t offset = 0, uint8_t length = 0);
|
||||
|
||||
void register_mqtt_topic(const std::string & topic, mqtt_subfunction_p f);
|
||||
// void register_cmd(const __FlashStringHelper * cmd, cmdfunction_p f, uint8_t flag = 0);
|
||||
|
||||
void publish_mqtt_ha_sensor();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user