Rename Power.* to PowerManager.* for clarity

This commit is contained in:
2025-02-16 01:10:33 +01:00
parent ff11ad95b0
commit 5efa7a5efd
20 changed files with 152 additions and 152 deletions

View File

@ -6,15 +6,15 @@ MultiColorLight::MultiColorLight()
};
void MultiColorLight::begin(void) {
if (!Power::waitForCurrentAllowance(
if (!PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_TOP_LEFT,
PowerParameters::CurrentConsumptions::CURRENT_LED_RGB_BASE,
MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL) &&
Power::waitForCurrentAllowance(
PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_TOP_RIGHT,
PowerParameters::CurrentConsumptions::CURRENT_LED_RGB_BASE,
MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL) &&
Power::waitForCurrentAllowance(
PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_BOTTOM,
PowerParameters::CurrentConsumptions::CURRENT_LED_RGB_BASE,
MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL)) {
@ -33,7 +33,7 @@ void MultiColorLight::setLed(uint8_t index, uint32_t color) {
float totalConsumption = modelCurrentConsumption(normalizedColor);
switch (index) {
case 0:
if (!Power::waitForCurrentAllowance(
if (!PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_TOP_RIGHT,
totalConsumption, MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL)) {
ESP_LOGW(TAG,
@ -44,7 +44,7 @@ void MultiColorLight::setLed(uint8_t index, uint32_t color) {
}
break;
case 1:
if (!Power::waitForCurrentAllowance(
if (!PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_TOP_LEFT, totalConsumption,
MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL)) {
ESP_LOGW(TAG,
@ -55,7 +55,7 @@ void MultiColorLight::setLed(uint8_t index, uint32_t color) {
}
break;
case 2:
if (!Power::waitForCurrentAllowance(
if (!PowerManager::waitForCurrentAllowance(
PowerParameters::PowerConsumers::LED_RGB_BOTTOM, totalConsumption,
MULTI_COLOR_LIGHT_MAX_EXECUTION_DELAY_MS, NULL)) {
ESP_LOGW(TAG,
@ -235,7 +235,7 @@ float MultiColorLight::modelChargeConsumption(leds leds, uint32_t color,
// TODO logging
break;
}
return ledsConsumption;
return ledsConsumption;
};
float MultiColorLight::modelChargeConsumption(leds leds, uint8_t red,
@ -243,4 +243,4 @@ float MultiColorLight::modelChargeConsumption(leds leds, uint8_t red,
uint16_t durationMs) {
return MultiColorLight::modelChargeConsumption(
leds, MultiColorLight::color(red, green, blue), durationMs);
};
};

View File

@ -11,7 +11,7 @@
*/
#ifndef MultiColorLight_h
#define MultiColorLight_h
#include "../power/Power.h"
#include "../power/PowerManager.h"
#include "ColorConstants.h"
#include <Adafruit_NeoPixel.h>