Loading...
Searching...
No Matches
hueplusplus::BridgeConfig Class Reference

General bridge configuration properties. More...

`#include <hueplusplus/BridgeConfig.h>`

Inheritance diagram for hueplusplus::BridgeConfig:
[legend]

## Public Member Functions

| BridgeConfig (std::shared_ptr< APICache > baseCache, std::chrono::steady_clock::duration refreshDuration)
| Construct BridgeConfig.
void | refresh (bool force=false)
| Refreshes internal cached state.
void | setRefreshDuration (std::chrono::steady_clock::duration refreshDuration)
| Sets custom refresh interval for the config.
std::vector< WhitelistedUser > | getWhitelistedUsers () const
| Get the list of whitelisted users.
void | removeUser (const std::string &userKey)
| Remove user from the whitelist.
bool | getLinkButton () const
| Get link button state.
void | pressLinkButton ()
| Set the link button state to pressed.
void | touchLink ()
| Add the closest lamp to the network.
std::string | getMACAddress () const
| Get bridge MAC address.
time::AbsoluteTime | getUTCTime () const
| Get current (of last refresh) UTC time of the bridge.
std::string | getTimezone () const
| Get configured timezone for the bridge.

## Protected Member Functions

| BridgeConfig (const BridgeConfig &)=default
| BridgeConfig (BridgeConfig &&)=default
BridgeConfig & | operator= (const BridgeConfig &)=default
BridgeConfig & | operator= (BridgeConfig &&)=default

## Detailed Description

General bridge configuration properties.

## Constructor & Destructor Documentation

## BridgeConfig() [1/3]

hueplusplus::BridgeConfig::BridgeConfig | ( | std::shared_ptr< APICache > | baseCache,
|  | std::chrono::steady_clock::duration | refreshDuration
| ) |  |

Construct BridgeConfig.

## BridgeConfig() [2/3]

hueplusplus::BridgeConfig::BridgeConfig | ( | const BridgeConfig & |  | ) |

protected default

## BridgeConfig() [3/3]

hueplusplus::BridgeConfig::BridgeConfig | ( | BridgeConfig && |  | ) |

protected default

## Member Function Documentation

## 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

Get bridge MAC address.

## 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()

time::AbsoluteTime hueplusplus::BridgeConfig::getUTCTime | ( |  | ) | const

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]

BridgeConfig & hueplusplus::BridgeConfig::operator= | ( | BridgeConfig && |  | ) |

protected default

## operator=() [2/2]

BridgeConfig & hueplusplus::BridgeConfig::operator= | ( | const BridgeConfig & |  | ) |

protected default

## 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:

- include/hueplusplus/BridgeConfig.h
- src/BridgeConfig.cpp