EmlaLockSafe
configuration::Configuration Class Reference

Static class accessing the configuration. More...

#include <Configuration.h>

Classes

class  TimeRestrictions
 Container to restrict the time when the safe can be opened. More...
 

Public Member Functions

 Configuration ()
 
const String & getSsid () const
 get the SSID(name) of your wifi More...
 
const String & getPwd () const
 get the password of your wifi. More...
 
const String & getUserId () const
 get the User ID extracted from the webpage settings > API More...
 
const String & getApiKey () const
 get the API Key extracted from the webpage settings > API More...
 
const String & getEmergencyKey () const
 get the emergency key of the safe More...
 
const bool & getDisableFailedSession () const
 get disable support of failed session. Note: If selected, the safe will be locked until the last known end date before a session was ended and marked as failed. Hygiene openings can no longer be triggered since the session is no longer valid! More...
 
const String & getTimezone () const
 get the timezone-string (e.g. "CET-1CEST,M3.5.0,M10.5.0/3") see also https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv More...
 
const String & getTimezoneName () const
 get the name to the timezone-string (e.g. "Europe/Berlin") More...
 
const unsigned long & getBacklightTimeOut () const
 get the timeout of display backlight in seconds More...
 
const bool & getAutoLockHygieneOpeningTimeout () const
 return if the safe should automatically lock after the time for hygiene opening is over. If not set, the safe stays unlocked until the hygiene opening is ended on the website. More...
 
const TimeRestrictionsgetTimeRestrictions () const
 get the timeout of display backlight in seconds More...
 
void setWifiSettings (const String &ssid, const String &pwd)
 Set the Wifi Settings. More...
 
void setConfigurationSettings (const String &userId, const String &apiKey, const bool &disableFailedSession, const String &timezoneName, const String &timezone, const long &backlightTimeOut, const bool &autoLockHygieneOpeningTimeout, const TimeRestrictions &timeRestrictions)
 Set the Configuration Settings. More...
 
const String & generateNewEmergencyKey ()
 Generates a new key and stores it to the file system. More...
 
void restoreFactoryDefaults ()
 Reset all values to the default values and write configuration. More...
 

Static Public Member Functions

static ConfigurationgetSingleton ()
 Get the Singleton object. More...
 
static Configurationbegin ()
 initialize the configuration object and load the configuration file More...
 

Protected Member Functions

void readConfiguration ()
 Read all configuration data from file. More...
 
void writeConfiguration ()
 writes all configuration values to the SPIFFS More...
 

Static Protected Member Functions

static Configuration ** getInstance ()
 Function providing the instance for the singleton. More...
 
static char getRandomChar ()
 Get a random character (A-Z, 0-9) More...
 

Protected Attributes

String ssid
 The SSID(name) of your wifi. More...
 
String pwd
 The password of your wifi. More...
 
String userId
 The User ID extracted from the webpage settings > API. More...
 
String apiKey
 The API Key extracted from the webpage settings > API. More...
 
String emergencyKey
 The emergency key. More...
 
bool disableFailedSession
 Disable support of failed session. Note: If selected, the safe will be locked until the last known end date before a session was ended and marked as failed. Hygiene openings can no longer be triggered since the session is no longer valid! More...
 
String timezone
 The timezone-string (e.g. "CET-1CEST,M3.5.0,M10.5.0/3") see also https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv. More...
 
String timezoneName
 The name to the timezone-string (e.g. "Europe/Berlin") More...
 
unsigned long backlightTimeOut
 Timeout of display backlight in seconds. More...
 
bool autoLockHygieneOpeningTimeout
 Automatically lock after the time for hygiene opening is over. If not set, the safe stays unlocked until the hygiene opening is ended on the website. More...
 
TimeRestrictions timeRestrictions
 Container to restrict the time when the safe can be opened. More...
 

Detailed Description

Static class accessing the configuration.

Constructor & Destructor Documentation

◆ Configuration()

configuration::Configuration::Configuration ( )
inline

Member Function Documentation

◆ begin()

static Configuration & configuration::Configuration::begin ( )
inlinestatic

initialize the configuration object and load the configuration file

◆ generateNewEmergencyKey()

const String & configuration::Configuration::generateNewEmergencyKey ( )
inline

Generates a new key and stores it to the file system.

◆ getApiKey()

const String & configuration::Configuration::getApiKey ( ) const
inline

get the API Key extracted from the webpage settings > API

◆ getAutoLockHygieneOpeningTimeout()

const bool & configuration::Configuration::getAutoLockHygieneOpeningTimeout ( ) const
inline

return if the safe should automatically lock after the time for hygiene opening is over. If not set, the safe stays unlocked until the hygiene opening is ended on the website.

◆ getBacklightTimeOut()

const unsigned long & configuration::Configuration::getBacklightTimeOut ( ) const
inline

get the timeout of display backlight in seconds

◆ getDisableFailedSession()

const bool & configuration::Configuration::getDisableFailedSession ( ) const
inline

get disable support of failed session. Note: If selected, the safe will be locked until the last known end date before a session was ended and marked as failed. Hygiene openings can no longer be triggered since the session is no longer valid!

◆ getEmergencyKey()

const String & configuration::Configuration::getEmergencyKey ( ) const
inline

get the emergency key of the safe

◆ getInstance()

static Configuration ** configuration::Configuration::getInstance ( )
inlinestaticprotected

Function providing the instance for the singleton.

◆ getPwd()

const String & configuration::Configuration::getPwd ( ) const
inline

get the password of your wifi.

◆ getRandomChar()

static char configuration::Configuration::getRandomChar ( )
inlinestaticprotected

Get a random character (A-Z, 0-9)

◆ getSingleton()

static Configuration & configuration::Configuration::getSingleton ( )
inlinestatic

Get the Singleton object.

◆ getSsid()

const String & configuration::Configuration::getSsid ( ) const
inline

get the SSID(name) of your wifi

◆ getTimeRestrictions()

const TimeRestrictions & configuration::Configuration::getTimeRestrictions ( ) const
inline

get the timeout of display backlight in seconds

◆ getTimezone()

const String & configuration::Configuration::getTimezone ( ) const
inline

get the timezone-string (e.g. "CET-1CEST,M3.5.0,M10.5.0/3") see also https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv

◆ getTimezoneName()

const String & configuration::Configuration::getTimezoneName ( ) const
inline

get the name to the timezone-string (e.g. "Europe/Berlin")

◆ getUserId()

const String & configuration::Configuration::getUserId ( ) const
inline

get the User ID extracted from the webpage settings > API

◆ readConfiguration()

void configuration::Configuration::readConfiguration ( )
inlineprotected

Read all configuration data from file.

◆ restoreFactoryDefaults()

void configuration::Configuration::restoreFactoryDefaults ( )
inline

Reset all values to the default values and write configuration.

◆ setConfigurationSettings()

void configuration::Configuration::setConfigurationSettings ( const String &  userId,
const String &  apiKey,
const bool &  disableFailedSession,
const String &  timezoneName,
const String &  timezone,
const long &  backlightTimeOut,
const bool &  autoLockHygieneOpeningTimeout,
const TimeRestrictions timeRestrictions 
)
inline

Set the Configuration Settings.

Parameters
userIdnew Emlalock API user id
apiKeynew Emlalock API key
disableFailedSessiondisable support of failed session. Note: If selected, the safe will be locked until the last known end date before a session was ended and marked as failed. Hygiene openings can no longer be triggered since the session is no longer valid!
timezoneNamenew name of timezone
timezonenew timezone string
backlightTimeOutnew timeout of display backlight in seconds
autoLockHygieneOpeningTimeoutAutomatically lock after the time for hygiene opening is over. If not set, the safe stays unlocked until the hygiene opening is ended on the website.
timeRestrictionsthe new time restrictions

◆ setWifiSettings()

void configuration::Configuration::setWifiSettings ( const String &  ssid,
const String &  pwd 
)
inline

Set the Wifi Settings.

Parameters
ssidnew ssid
pwdnew password

◆ writeConfiguration()

void configuration::Configuration::writeConfiguration ( )
inlineprotected

writes all configuration values to the SPIFFS

Member Data Documentation

◆ apiKey

String configuration::Configuration::apiKey
protected

The API Key extracted from the webpage settings > API.

◆ autoLockHygieneOpeningTimeout

bool configuration::Configuration::autoLockHygieneOpeningTimeout
protected

Automatically lock after the time for hygiene opening is over. If not set, the safe stays unlocked until the hygiene opening is ended on the website.

◆ backlightTimeOut

unsigned long configuration::Configuration::backlightTimeOut
protected

Timeout of display backlight in seconds.

◆ disableFailedSession

bool configuration::Configuration::disableFailedSession
protected

Disable support of failed session. Note: If selected, the safe will be locked until the last known end date before a session was ended and marked as failed. Hygiene openings can no longer be triggered since the session is no longer valid!

◆ emergencyKey

String configuration::Configuration::emergencyKey
protected

The emergency key.

◆ pwd

String configuration::Configuration::pwd
protected

The password of your wifi.

◆ ssid

String configuration::Configuration::ssid
protected

The SSID(name) of your wifi.

◆ timeRestrictions

TimeRestrictions configuration::Configuration::timeRestrictions
protected

Container to restrict the time when the safe can be opened.

◆ timezone

String configuration::Configuration::timezone
protected

The timezone-string (e.g. "CET-1CEST,M3.5.0,M10.5.0/3") see also https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv.

◆ timezoneName

String configuration::Configuration::timezoneName
protected

The name to the timezone-string (e.g. "Europe/Berlin")

◆ userId

String configuration::Configuration::userId
protected

The User ID extracted from the webpage settings > API.


The documentation for this class was generated from the following file: