Commit 1388003d8a725c667d01bd56d6177072a5e86e80

Authored by Nodeduino
Committed by Moritz Wirger
1 parent 5f7e4699

Add new function in HueLight

- add function for getting the id of a light
hueplusplus/HueLight.cpp
@@ -61,6 +61,11 @@ std::string HueLight::getName() const @@ -61,6 +61,11 @@ std::string HueLight::getName() const
61 return state["name"].asString(); 61 return state["name"].asString();
62 } 62 }
63 63
  64 +int HueLight::getId() const
  65 +{
  66 + return id;
  67 +}
  68 +
64 bool HueLight::setName(const std::string& name) 69 bool HueLight::setName(const std::string& name)
65 { 70 {
66 Json::Value request(Json::objectValue); 71 Json::Value request(Json::objectValue);
hueplusplus/include/HueLight.h
@@ -135,6 +135,11 @@ public: @@ -135,6 +135,11 @@ public:
135 //! \return String containig the name of the light 135 //! \return String containig the name of the light
136 std::string getName() const; 136 std::string getName() const;
137 137
  138 + //! \brief Const function that returns the id of this light
  139 + //!
  140 + //! \return integer representing the light id
  141 + int getId() const;
  142 +
138 //! \brief Function that sets the name of the light 143 //! \brief Function that sets the name of the light
139 //! 144 //!
140 //! \return Bool that is true on success 145 //! \return Bool that is true on success