23 #ifndef INCLUDE_HUEPLUSPLUS_HUE_H 24 #define INCLUDE_HUEPLUSPLUS_HUE_H 50 #include "json/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;
129 std::map<std::string, std::string> clientkeys;
131 std::shared_ptr<const IHttpHandler> http_handler;
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);
180 void setRefreshDuration(std::chrono::steady_clock::duration refreshDuration);
185 std::string getBridgeIP()
const;
190 bool startStreaming(std::string group_identifier);
195 bool stopStreaming(std::string group_identifier);
200 int getBridgePort()
const;
211 std::string requestUsername();
216 std::string getUsername()
const;
221 std::string getClientKey()
const;
226 void setIP(
const std::string& ip);
232 void setPort(
const int port);
284 void setHttpHandler(std::shared_ptr<const IHttpHandler> handler);
290 std::string clientkey;
293 std::shared_ptr<const IHttpHandler> http_handler;
294 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;
void addClientKey(const std::string &mac, const std::string &clientkey)
Function that adds a client key to the clientkeys map.
Definition: Bridge.cpp:114
Parameters for creating a new Schedule.
Definition: Schedule.h:150
Handles a ResourceList where Resources can be added by the user.
Definition: ResourceList.h:285
Bridge getBridge(const BridgeIdentification &identification, bool sharedState=false)
Gets a Hue bridge based on its identification.
Definition: Bridge.cpp:78
Namespace for the hueplusplus library.
Definition: Action.h:27
int port
Definition: Bridge.h:67
std::string mac
Definition: Bridge.h:68
void addUsername(const std::string &mac, const std::string &username)
Function that adds a username to the usernames map.
Definition: Bridge.cpp:109
Parameters for creating a new Rule.
Definition: Rule.h:150
Handles a group list with the special group 0.
Definition: ResourceList.h:331
const std::map< std::string, std::string > & getAllUsernames() const
Function that returns a map of mac addresses and usernames.
Definition: Bridge.cpp:119
Parameters for creating a new Scene.
Definition: Scene.h:267
const std::string username
Definition: BridgeSetup.cpp:47
Bridge class for a bridge.
Definition: Bridge.h:138
static std::string normalizeMac(std::string input)
Normalizes mac address to plain hex number.
Definition: Bridge.cpp:124
std::vector< BridgeIdentification > findBridges() const
Finds all bridges in the network and returns them.
Definition: Bridge.cpp:43
General bridge configuration properties.
Definition: BridgeConfig.h:55
Handles a list of Sensors with type specific getters.
Definition: SensorList.h:33
BridgeFinder(std::shared_ptr< const IHttpHandler > handler)
Constructor of BridgeFinder class.
Definition: Bridge.cpp:41
std::string ip
Definition: Bridge.h:66
Handles a ResourceList of physical devices which can be searched for.
Definition: ResourceList.h:239