General bridge configuration properties.
More...
#include <hueplusplus/BridgeConfig.h>
General bridge configuration properties.
◆ BridgeConfig() [1/3]
hueplusplus::BridgeConfig::BridgeConfig |
( |
std::shared_ptr< APICache > |
baseCache, |
|
|
std::chrono::steady_clock::duration |
refreshDuration |
|
) |
| |
◆ BridgeConfig() [2/3]
hueplusplus::BridgeConfig::BridgeConfig |
( |
const BridgeConfig & |
| ) |
|
|
protecteddefault |
◆ BridgeConfig() [3/3]
◆ getLinkButton()
bool hueplusplus::BridgeConfig::getLinkButton |
( |
| ) |
const |
Get link button state.
- Returns
- true when link button was pressed in the last 30 seconds.
Indicates whether new users can be added currently.
◆ getMACAddress()
std::string hueplusplus::BridgeConfig::getMACAddress |
( |
| ) |
const |
◆ getTimezone()
std::string hueplusplus::BridgeConfig::getTimezone |
( |
| ) |
const |
Get configured timezone for the bridge.
- Note
- For times not in UTC, the timezone of the program and the bridge are assumed to be identical.
◆ getUTCTime()
Get current (of last refresh) UTC time of the bridge.
◆ getWhitelistedUsers()
std::vector< WhitelistedUser > hueplusplus::BridgeConfig::getWhitelistedUsers |
( |
| ) |
const |
Get the list of whitelisted users.
- Returns
- All users authorized for API access
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pressLinkButton()
void hueplusplus::BridgeConfig::pressLinkButton |
( |
| ) |
|
Set the link button state to pressed.
◆ refresh()
void hueplusplus::BridgeConfig::refresh |
( |
bool |
force = false | ) |
|
Refreshes internal cached state.
- Parameters
-
force | true forces a refresh, regardless of how long the last refresh was ago. false to only refresh when enough time has passed (needed e.g. when calling only const methods). |
- Exceptions
-
std::system_error | when system or socket operations fail |
HueException | when response contained no body |
HueAPIResponseException | when response contains an error |
nlohmann::json::parse_error | when response could not be parsed |
◆ removeUser()
void hueplusplus::BridgeConfig::removeUser |
( |
const std::string & |
userKey | ) |
|
Remove user from the whitelist.
- Parameters
-
userKey | The API username of the user to remove |
- Exceptions
-
std::system_error | when system or socket operations fail |
HueException | when response contained no body |
HueAPIResponseException | when response contains an error |
nlohmann::json::parse_error | when response could not be parsed |
◆ setRefreshDuration()
void hueplusplus::BridgeConfig::setRefreshDuration |
( |
std::chrono::steady_clock::duration |
refreshDuration | ) |
|
Sets custom refresh interval for the config.
- Parameters
-
refreshDuration | The new minimum duration between refreshes. May be 0 or c_refreshNever. |
◆ touchLink()
void hueplusplus::BridgeConfig::touchLink |
( |
| ) |
|
Add the closest lamp to the network.
The documentation for this class was generated from the following files: