NUM_TAGS is used to check of overflow

This commit is contained in:
proddy
2023-01-07 14:39:30 +01:00
parent 8cd08fa765
commit c7628ac07f
2 changed files with 11 additions and 5 deletions

View File

@@ -178,7 +178,12 @@ class DeviceValue {
uint16_t max,
uint8_t state);
// has values
bool hasValue() const;
bool has_tag() const {
return ((tag < DeviceValue::NUM_TAGS) && (tag != DeviceValue::DeviceValueTAG::TAG_NONE));
}
bool get_min_max(int16_t & dv_set_min, uint16_t & dv_set_max);
void set_custom_minmax();
@@ -204,7 +209,7 @@ class DeviceValue {
static const char * DeviceValueUOM_s[];
static const char * const * DeviceValueTAG_s[];
static const char * const DeviceValueTAG_mqtt[];
static size_t tag_count; // # tags
static uint8_t NUM_TAGS; // # tags
};
}; // namespace emsesp