Commit 6f8222e37b28b2ef8007cc9fea8137229ff7dcfb

Authored by Nodeduino
Committed by Moritz Wirger
1 parent 8c3ccddf

Add const getName function in HueLight

hueplusplus/HueLight.cpp
@@ -51,6 +51,11 @@ std::string HueLight::getName() @@ -51,6 +51,11 @@ std::string HueLight::getName()
51 return state["name"].asString(); 51 return state["name"].asString();
52 } 52 }
53 53
  54 +std::string HueLight::getName() const
  55 +{
  56 + return state["name"].asString();
  57 +}
  58 +
54 bool HueLight::setName(const std::string& name) 59 bool HueLight::setName(const std::string& name)
55 { 60 {
56 Json::Value request(Json::objectValue); 61 Json::Value request(Json::objectValue);
hueplusplus/include/HueLight.h
@@ -123,6 +123,12 @@ public: @@ -123,6 +123,12 @@ public:
123 //! \return String containig the name of the light 123 //! \return String containig the name of the light
124 std::string getName(); 124 std::string getName();
125 125
  126 + //! \brief Const function that returns the name of the light.
  127 + //!
  128 + //! \note This will not refresh the light state
  129 + //! \return String containig the name of the light
  130 + std::string getName() const;
  131 +
126 //! \brief Function that sets the name of the light 132 //! \brief Function that sets the name of the light
127 //! 133 //!
128 //! \return Bool that is true on success 134 //! \return Bool that is true on success