Loading...
Searching...
No Matches
LibConfig.h
Go to the documentation of this file.
#ifndef INCLUDE_HUEPLUSPLUS_HUE_CONFIG_H
#define INCLUDE_HUEPLUSPLUS_HUE_CONFIG_H
#include <chrono>
namespace hueplusplus
{
class Config
{
private:
using duration = std::chrono::steady_clock::duration;
public:
duration getPreAlertDelay() const { return preAlertDelay; }
duration getPostAlertDelay() const { return postAlertDelay; }
duration getUPnPTimeout() const { return upnpTimeout; }
duration getBridgeRequestDelay() const { return bridgeRequestDelay; }
duration getRequestUsernameTimeout() const { return requestUsernameDelay; }
duration getRequestUsernameAttemptInterval() const { return requestUsernameAttemptInterval; }
static Config& instance()
{
static Config c;
return c;
}
protected:
Config() = default;
protected:
duration preAlertDelay = std::chrono::milliseconds(120);
duration postAlertDelay = std::chrono::milliseconds(1600);
duration upnpTimeout = std::chrono::seconds(5);
duration bridgeRequestDelay = std::chrono::milliseconds(100);
duration requestUsernameDelay = std::chrono::seconds(35);
duration requestUsernameAttemptInterval = std::chrono::seconds(1);
};
} // namespace hueplusplus
#endif
hueplusplus::Config::getPostAlertDelay
duration getPostAlertDelay() const
Delay for advanced alerts after the actual alert.
Definition LibConfig.h:42
hueplusplus::Config::requestUsernameDelay
duration requestUsernameDelay
Definition LibConfig.h:70
hueplusplus::Config::getRequestUsernameAttemptInterval
duration getRequestUsernameAttemptInterval() const
Interval in which username requests are attempted.
Definition LibConfig.h:54
hueplusplus::Config::getUPnPTimeout
duration getUPnPTimeout() const
Timeout for UPnP multicast request.
Definition LibConfig.h:45
hueplusplus::Config::getPreAlertDelay
duration getPreAlertDelay() const
Delay for advanced alerts before the actual alert.
Definition LibConfig.h:40
hueplusplus::Config::instance
static Config & instance()
Get config instance.
Definition LibConfig.h:57
hueplusplus::Config::getBridgeRequestDelay
duration getBridgeRequestDelay() const
Delay between bridge requests.
Definition LibConfig.h:48
hueplusplus::Config::bridgeRequestDelay
duration bridgeRequestDelay
Definition LibConfig.h:69
hueplusplus::Config::Config
Config()=default
hueplusplus::Config::upnpTimeout
duration upnpTimeout
Definition LibConfig.h:68
hueplusplus::Config::requestUsernameAttemptInterval
duration requestUsernameAttemptInterval
Definition LibConfig.h:71
hueplusplus::Config::getRequestUsernameTimeout
duration getRequestUsernameTimeout() const
Timeout for Bridge::requestUsername, waits until link button was pressed.
Definition LibConfig.h:51
hueplusplus::Config::postAlertDelay
duration postAlertDelay
Definition LibConfig.h:67
hueplusplus::Config::preAlertDelay
duration preAlertDelay
Definition LibConfig.h:66
hueplusplus
Namespace for the hueplusplus library.
Definition Action.h:28