mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 15:35:59 -07:00
document state
This commit is contained in:
@@ -107,7 +107,9 @@ struct UrlMatch {
|
||||
return method && method_len == strlen(str) && memcmp(method, str, method_len) == 0;
|
||||
}
|
||||
|
||||
/// Check if method is empty or "state" (for sub-device GET requests)
|
||||
/// Check if method is empty or "state" (for backward compatibility with old frontends)
|
||||
/// Old frontends send /{domain}/{entity}/state for GET requests, so "state" is treated as no action.
|
||||
/// This is safe because no ESPHome entity type has a "state" action - actions are like "turn_on", "toggle", etc.
|
||||
bool method_empty() const { return method_len == 0 || this->method_equals("state"); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user