diff --git a/hueplusplus/HueLight.cpp b/hueplusplus/HueLight.cpp index c62cb69..73ef334 100755 --- a/hueplusplus/HueLight.cpp +++ b/hueplusplus/HueLight.cpp @@ -39,12 +39,17 @@ bool HueLight::Off(uint8_t transition) return OffNoRefresh(transition); } -bool HueLight::IsOn() +bool HueLight::isOn() { refreshState(); return state["state"]["on"].asBool(); } +bool HueLight::isOn() const +{ + return state["state"]["on"].asBool(); +} + std::string HueLight::getName() { refreshState(); diff --git a/hueplusplus/include/HueLight.h b/hueplusplus/include/HueLight.h index aa00afa..92bc217 100755 --- a/hueplusplus/include/HueLight.h +++ b/hueplusplus/include/HueLight.h @@ -116,7 +116,13 @@ public: //! \brief Function to check whether a light is on or off //! //! \return Bool that is true, when the light is on and false, when off - bool IsOn(); + bool isOn(); + + //! \brief Const function to check whether a light is on or off + //! + //! \note This will not refresh the light state + //! \return Bool that is true, when the light is on and false, when off + bool isOn() const; //! \brief Function that returns the name of the light. //!