Main class for FauxmoESP.
Definition at line 32 of file FauxmoESP.h.
#include <FauxmoESP.h>
◆ FauxmoESP()
FauxmoESP::FauxmoESP |
( |
bool |
enableWebServer = true | ) |
|
|
explicit |
Construct a new FauxmoESP object.
- Parameters
-
enableWebServer | Whether to enable the web server or not |
Definition at line 11 of file FauxmoESP.cpp.
◆ ~FauxmoESP()
FauxmoESP::~FauxmoESP |
( |
| ) |
|
◆ addLight()
Add a light to the FauxmoESP object.
- Parameters
-
name | The name of the light |
capabilities | The capabilities of the light, defaults to LightCapabilities() |
initialState | The initial state of the light, defaults to LightState() |
- Returns
- Light* The light object or nullptr if the light could not be added
Definition at line 370 of file FauxmoESP.cpp.
◆ checkUsername()
bool FauxmoESP::checkUsername |
( |
const String & |
username | ) |
|
Check if the username is correct.
- Parameters
-
username | The username to check |
- Returns
- true If the username is correct, false otherwise
Definition at line 242 of file FauxmoESP.cpp.
◆ getLightByDeviceId()
Light * FauxmoESP::getLightByDeviceId |
( |
ushort |
deviceId | ) |
|
Get a light by its device id.
- Parameters
-
deviceId | The device id of the light |
- Returns
- Light* The light object or nullptr if the light could not be found
Definition at line 424 of file FauxmoESP.cpp.
◆ getLightByName()
Light * FauxmoESP::getLightByName |
( |
const String & |
name | ) |
|
Get a light by its name.
- Parameters
-
name | The name of the light |
- Returns
- Light* The light object or nullptr if the light could not be found
Definition at line 409 of file FauxmoESP.cpp.
◆ processRequest()
void FauxmoESP::processRequest |
( |
const String & |
url, |
|
|
const String & |
body, |
|
|
const String & |
method, |
|
|
String & |
response, |
|
|
uint16_t * |
resultCode |
|
) |
| |
Process a request, only used when the web server is disabled.
- Parameters
-
url | The full URL of the request |
body | The body of the request |
method | The method of the request |
response | Returns the response |
resultCode | Returns the result code |
Definition at line 34 of file FauxmoESP.cpp.
◆ removeLight()
void FauxmoESP::removeLight |
( |
const String & |
deviceId | ) |
|
Remove a light from the FauxmoESP object.
- Parameters
-
deviceId | The device id of the light |
Definition at line 392 of file FauxmoESP.cpp.
◆ setCheckUsername()
void FauxmoESP::setCheckUsername |
( |
bool |
checkUsername | ) |
|
|
inline |
Set whether the username should be checked or not If a request is made with a username that does not match the known one, the request will be denied.
- Parameters
-
checkUsername | Whether the username should be checked or not |
Definition at line 120 of file FauxmoESP.h.
◆ setup()
void FauxmoESP::setup |
( |
OnStateChangeCallback |
onStateChangeCallback, |
|
|
OnGetStateCallback |
onGetStateCallback |
|
) |
| |
Setup the FauxmoESP object.
- Parameters
-
onStateChangeCallback | Callback to be called when a device state changes |
onGetStateCallback | Callback to be called when a device state is requested |
Definition at line 21 of file FauxmoESP.cpp.
◆ setUsername()
void FauxmoESP::setUsername |
( |
const String & |
username | ) |
|
|
inline |
Set the username.
- Parameters
-
Definition at line 146 of file FauxmoESP.h.
◆ setWebServerEnabled()
void FauxmoESP::setWebServerEnabled |
( |
bool |
enabled | ) |
|
|
inline |
Set whether the web server is enabled or not.
- Parameters
-
enabled | Whether the web server is enabled or not |
Definition at line 109 of file FauxmoESP.h.
◆ setWebServerPort()
void FauxmoESP::setWebServerPort |
( |
uint16_t |
port | ) |
|
|
inline |
Set the web server port.
- Parameters
-
Definition at line 155 of file FauxmoESP.h.
◆ teardown()
void FauxmoESP::teardown |
( |
| ) |
|
◆ update()
void FauxmoESP::update |
( |
| ) |
|
The documentation for this class was generated from the following files: