mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Update Parser::is_true() for JSON keys
This commit is contained in:
parent
43dff43a27
commit
fc9e14a926
@ -154,6 +154,11 @@ bool Parser::is_true(const char* s)
|
||||
!strcmp_P(s, PSTR("1")));
|
||||
}
|
||||
|
||||
bool Parser::is_true(JsonVariant json)
|
||||
{
|
||||
return is_true(json.as<std::string>().c_str());
|
||||
}
|
||||
|
||||
bool Parser::is_only_digits(const char* s)
|
||||
{
|
||||
size_t digits = 0;
|
||||
|
@ -15,6 +15,7 @@ class Parser {
|
||||
static uint8_t get_action_id(const char* action);
|
||||
static uint16_t get_sdbm(const char* str);
|
||||
static bool is_true(const char* s);
|
||||
static bool is_true(JsonVariant json);
|
||||
static bool is_only_digits(const char* s);
|
||||
static int format_bytes(size_t filesize, char* buf, size_t len);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user