23#ifndef INCLUDE_HUEPLUSPLUS_HUE_H
24#define INCLUDE_HUEPLUSPLUS_HUE_H
50#include <nlohmann/json.hpp>
75 BridgeFinder(std::shared_ptr<const IHttpHandler> handler);
83 std::vector<BridgeIdentification>
findBridges()
const;
107 void addClientKey(
const std::string& mac,
const std::string& clientkey);
126 static std::string parseDescription(
const std::string& description);
128 std::map<std::string, std::string> usernames;
130 std::map<std::string, std::string> clientkeys;
132 std::shared_ptr<const IHttpHandler> http_handler;
160 Bridge(
const std::string& ip,
const int port,
const std::string&
username,
161 std::shared_ptr<const IHttpHandler> handler,
const std::string& clientkey =
"",
162 std::chrono::steady_clock::duration refreshDuration = std::chrono::seconds(10),
bool sharedState =
false);
226 void setIP(
const std::string& ip);
284 void setHttpHandler(std::shared_ptr<const IHttpHandler> handler);
290 std::string clientkey;
293 std::shared_ptr<const IHttpHandler> http_handler;
295 std::chrono::steady_clock::duration refreshDuration;
296 std::shared_ptr<APICache> stateCache;
297 detail::MakeCopyable<LightList> lightList;
298 detail::MakeCopyable<GroupList> groupList;
299 detail::MakeCopyable<ScheduleList> scheduleList;
300 detail::MakeCopyable<SceneList> sceneList;
301 detail::MakeCopyable<SensorList> sensorList;
302 detail::MakeCopyable<RuleList> ruleList;
303 detail::MakeCopyable<BridgeConfig> bridgeConfig;
const std::string username
Definition BridgeSetup.cpp:47
General bridge configuration properties.
Definition BridgeConfig.h:56
std::vector< BridgeIdentification > findBridges() const
Finds all bridges in the network and returns them.
Definition Bridge.cpp:43
Bridge getBridge(const BridgeIdentification &identification, bool sharedState=false)
Gets a Hue bridge based on its identification.
Definition Bridge.cpp:78
void addUsername(const std::string &mac, const std::string &username)
Function that adds a username to the usernames map.
Definition Bridge.cpp:109
const std::map< std::string, std::string > & getAllUsernames() const
Function that returns a map of mac addresses and usernames.
Definition Bridge.cpp:119
void addClientKey(const std::string &mac, const std::string &clientkey)
Function that adds a client key to the clientkeys map.
Definition Bridge.cpp:114
static std::string normalizeMac(std::string input)
Normalizes mac address to plain hex number.
Definition Bridge.cpp:124
Bridge class for a bridge.
Definition Bridge.h:139
SceneList & scenes()
Provides access to the Scenes on the bridge.
Definition Bridge.cpp:370
BridgeConfig & config()
Provides access to the configuration of the bridge.
Definition Bridge.cpp:330
std::string getBridgeIP() const
Function to get the ip address of the hue bridge.
Definition Bridge.cpp:198
std::string requestUsername()
Send a username request to the Hue bridge.
Definition Bridge.cpp:208
bool stopStreaming(std::string group_identifier)
Function to set stream mode to active for entertainment mode.
Definition Bridge.cpp:282
LightList & lights()
Provides access to the Lights on the bridge.
Definition Bridge.cpp:340
std::string getUsername() const
Function that returns the username.
Definition Bridge.cpp:310
std::string getClientKey() const
Function that returns the client key.
Definition Bridge.cpp:315
GroupList & groups()
Provides access to the Groups on the bridge.
Definition Bridge.cpp:350
bool startStreaming(std::string group_identifier)
Function to set stream mode to active for entertainment mode.
Definition Bridge.cpp:259
RuleList & rules()
Provides access to the Rules on the bridge.
Definition Bridge.cpp:390
void refresh()
Refreshes the bridge state.
Definition Bridge.cpp:181
int getBridgePort() const
Function to get the port of the hue bridge.
Definition Bridge.cpp:203
SensorList & sensors()
Provides access to the Sensors on the bridge.
Definition Bridge.cpp:380
void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration)
Sets refresh interval for the whole bridge state.
Definition Bridge.cpp:186
void setPort(const int port)
Function to set the port of this class representing a bridge.
Definition Bridge.cpp:325
void setIP(const std::string &ip)
Function to set the ip address of this class representing a bridge.
Definition Bridge.cpp:320
ScheduleList & schedules()
Provides access to the Schedules on the bridge.
Definition Bridge.cpp:360
Parameters for creating a new Rule.
Definition Rule.h:151
Parameters for creating a new Scene.
Definition Scene.h:268
Parameters for creating a new Schedule.
Definition Schedule.h:151
Handles a ResourceList where Resources can be added by the user.
Definition ResourceList.h:286
Handles a group list with the special group 0.
Definition ResourceList.h:332
Handles a ResourceList of physical devices which can be searched for.
Definition ResourceList.h:240
Handles a list of Sensors with type specific getters.
Definition SensorList.h:34
Namespace for the hueplusplus library.
Definition Action.h:28
std::string ip
Definition Bridge.h:66
std::string mac
Definition Bridge.h:68
int port
Definition Bridge.h:67