Browse Source

Fixed some method access levels that got messy over time.

pull/4/head
Maurice Makaay 3 years ago
parent
commit
00941c6975
6 changed files with 11 additions and 9 deletions
  1. +1
    -1
      light/color_instant_handler.h
  2. +1
    -1
      light/color_night_light.h
  3. +1
    -1
      light/color_off.h
  4. +2
    -1
      light/color_rgb_light.h
  5. +4
    -4
      light/color_transition_handler.h
  6. +2
    -1
      light/color_white_light.h

+ 1
- 1
light/color_instant_handler.h View File

@ -27,7 +27,7 @@ namespace bs2 {
* - RGB light: based on RGB values + brightness * - RGB light: based on RGB values + brightness
*/ */
class ColorInstantHandler : public GPIOOutputs { class ColorInstantHandler : public GPIOOutputs {
protected:
public:
bool set_light_color_values(light::LightColorValues v) { bool set_light_color_values(light::LightColorValues v) {
GPIOOutputs *delegate; GPIOOutputs *delegate;


+ 1
- 1
light/color_night_light.h View File

@ -18,7 +18,7 @@ namespace bs2 {
* more natural. * more natural.
*/ */
class ColorNightLight : public GPIOOutputs { class ColorNightLight : public GPIOOutputs {
protected:
public:
bool set_light_color_values(light::LightColorValues v) { bool set_light_color_values(light::LightColorValues v) {
// Note: I do not check for a brightness at or below 0.01 (1%) here, // Note: I do not check for a brightness at or below 0.01 (1%) here,
// because the lowest brightness setting from Home Assistant turns // because the lowest brightness setting from Home Assistant turns


+ 1
- 1
light/color_off.h View File

@ -14,7 +14,7 @@ namespace bs2 {
* This class can handle the GPIO outputs in case the light of turned off. * This class can handle the GPIO outputs in case the light of turned off.
*/ */
class ColorOff : public GPIOOutputs { class ColorOff : public GPIOOutputs {
protected:
public:
bool set_light_color_values(light::LightColorValues v) { bool set_light_color_values(light::LightColorValues v) {
if (v.get_state() != 0.0f && v.get_brightness() != 0.0f) { if (v.get_state() != 0.0f && v.get_brightness() != 0.0f) {
return false; return false;


+ 2
- 1
light/color_rgb_light.h View File

@ -245,7 +245,7 @@ static const RGBCircle rgb_circle_ {{
* based on RGB color values + brightness. * based on RGB color values + brightness.
*/ */
class ColorRGBLight : public GPIOOutputs { class ColorRGBLight : public GPIOOutputs {
protected:
public:
bool set_light_color_values(light::LightColorValues v) { bool set_light_color_values(light::LightColorValues v) {
if (v.get_white() > 0.0f) { if (v.get_white() > 0.0f) {
return false; return false;
@ -340,6 +340,7 @@ protected:
apply_brightness_(p, brightness, rgb); apply_brightness_(p, brightness, rgb);
} }
protected:
/** /**
* Returns the position on an RGB ring in degrees (0 - 359). * Returns the position on an RGB ring in degrees (0 - 359).
*/ */


+ 4
- 4
light/color_transition_handler.h View File

@ -49,6 +49,10 @@ class ColorTransitionHandler : public GPIOOutputs {
public: public:
ColorTransitionHandler(LightStateTransformerInspector *inspector) : transformer_(inspector) {} ColorTransitionHandler(LightStateTransformerInspector *inspector) : transformer_(inspector) {}
light::LightColorValues get_end_values() {
return end_light_values_;
}
bool set_light_color_values(light::LightColorValues values) { bool set_light_color_values(light::LightColorValues values) {
if (!light_state_has_active_transition_()) { if (!light_state_has_active_transition_()) {
// Remember the last active light color values. When a transition // Remember the last active light color values. When a transition
@ -90,10 +94,6 @@ public:
return true; return true;
} }
light::LightColorValues get_end_values() {
return end_light_values_;
}
protected: protected:
bool active_ = false; bool active_ = false;
float progress_ = 0.0f; float progress_ = 0.0f;


+ 2
- 1
light/color_white_light.h View File

@ -73,7 +73,7 @@ static const RGBWLevelsTable rgbw_levels_100_ {{
* based on color temperature + brightness. * based on color temperature + brightness.
*/ */
class ColorWhiteLight : public GPIOOutputs { class ColorWhiteLight : public GPIOOutputs {
protected:
public:
bool set_light_color_values(light::LightColorValues v) { bool set_light_color_values(light::LightColorValues v) {
if (v.get_white() == 0.0f) { if (v.get_white() == 0.0f) {
return false; return false;
@ -93,6 +93,7 @@ protected:
return true; return true;
} }
protected:
float clamp_temperature_(float temperature) float clamp_temperature_(float temperature)
{ {
if (temperature > MIRED_MAX) if (temperature > MIRED_MAX)


Loading…
Cancel
Save