ESPHome 2026.1.1
Loading...
Searching...
No Matches
esphome::web_server::UrlMatch Struct Reference

Internal helper struct that is used to parse incoming URLs. More...

#include <web_server.h>

Public Member Functions

bool domain_equals (const char *str) const
 
bool method_equals (const char *str) const
 
bool domain_equals (const __FlashStringHelper *str) const
 
bool method_equals (const __FlashStringHelper *str) const
 
EntityMatchResult match_entity (EntityBase *entity) const
 Match entity by name first, then fall back to object_id with deprecation warning Returns EntityMatchResult with match status and whether action segment is empty.
 

Data Fields

StringRef domain
 Domain within URL, for example "sensor".
 
StringRef id
 Entity name/id within URL, for example "Temperature".
 
StringRef method
 Method within URL, for example "turn_on".
 
StringRef device_name
 Device name within URL, empty for main device.
 
bool valid {false}
 Whether this match is valid.
 

Detailed Description

Internal helper struct that is used to parse incoming URLs.

Definition at line 52 of file web_server.h.

Member Function Documentation

◆ domain_equals() [1/2]

bool esphome::web_server::UrlMatch::domain_equals ( const __FlashStringHelper * str) const
inline

Definition at line 67 of file web_server.h.

◆ domain_equals() [2/2]

bool esphome::web_server::UrlMatch::domain_equals ( const char * str) const
inline

Definition at line 62 of file web_server.h.

◆ match_entity()

EntityMatchResult esphome::web_server::UrlMatch::match_entity ( EntityBase * entity) const

Match entity by name first, then fall back to object_id with deprecation warning Returns EntityMatchResult with match status and whether action segment is empty.

Definition at line 139 of file web_server.cpp.

◆ method_equals() [1/2]

bool esphome::web_server::UrlMatch::method_equals ( const __FlashStringHelper * str) const
inline

Definition at line 68 of file web_server.h.

◆ method_equals() [2/2]

bool esphome::web_server::UrlMatch::method_equals ( const char * str) const
inline

Definition at line 63 of file web_server.h.

Field Documentation

◆ device_name

StringRef esphome::web_server::UrlMatch::device_name

Device name within URL, empty for main device.

Definition at line 57 of file web_server.h.

◆ domain

StringRef esphome::web_server::UrlMatch::domain

Domain within URL, for example "sensor".

Definition at line 53 of file web_server.h.

◆ id

StringRef esphome::web_server::UrlMatch::id

Entity name/id within URL, for example "Temperature".

Definition at line 54 of file web_server.h.

◆ method

StringRef esphome::web_server::UrlMatch::method

Method within URL, for example "turn_on".

Definition at line 55 of file web_server.h.

◆ valid

bool esphome::web_server::UrlMatch::valid {false}

Whether this match is valid.

Definition at line 59 of file web_server.h.


The documentation for this struct was generated from the following files: