Fix relay id on log
This commit is contained in:
@@ -795,12 +795,12 @@ script:
|
|||||||
case 1:
|
case 1:
|
||||||
if (light_index >= id(gb_lights_1).size()) {
|
if (light_index >= id(gb_lights_1).size()) {
|
||||||
ESP_LOGE("core_hw_leds", "Invalid set with %s light for Relay %" PRIu8,
|
ESP_LOGE("core_hw_leds", "Invalid set with %s light for Relay %" PRIu8,
|
||||||
light_mode_group_1.c_str(), light_index);
|
light_mode_group_1.c_str(), light_index+1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state and !id(gb_lights_1)[light_index]->current_values.is_on()) {
|
if (state and !id(gb_lights_1)[light_index]->current_values.is_on()) {
|
||||||
ESP_LOGI("core_hw_leds", "Turn-on %s light for Relay %" PRIu8,
|
ESP_LOGI("core_hw_leds", "Turn-on %s light for Relay %" PRIu8,
|
||||||
light_mode_group_1.c_str(), light_index);
|
light_mode_group_1.c_str(), light_index+1);
|
||||||
auto call = id(gb_lights_1)[light_index]->turn_on();
|
auto call = id(gb_lights_1)[light_index]->turn_on();
|
||||||
if (LIGHT_TRANSITION_TURN_ON > 0)
|
if (LIGHT_TRANSITION_TURN_ON > 0)
|
||||||
call.set_transition_length(LIGHT_TRANSITION_TURN_ON); // in ms
|
call.set_transition_length(LIGHT_TRANSITION_TURN_ON); // in ms
|
||||||
@@ -809,7 +809,7 @@ script:
|
|||||||
call.perform();
|
call.perform();
|
||||||
} else if (!state and id(gb_lights_1)[light_index]->current_values.is_on()) {
|
} else if (!state and id(gb_lights_1)[light_index]->current_values.is_on()) {
|
||||||
ESP_LOGI("core_hw_leds", "Turn-off %s light for Relay %" PRIu8,
|
ESP_LOGI("core_hw_leds", "Turn-off %s light for Relay %" PRIu8,
|
||||||
light_mode_group_1.c_str(), light_index);
|
light_mode_group_1.c_str(), light_index+1);
|
||||||
auto call = id(gb_lights_1)[light_index]->turn_off();
|
auto call = id(gb_lights_1)[light_index]->turn_off();
|
||||||
if (LIGHT_TRANSITION_TURN_OFF > 0)
|
if (LIGHT_TRANSITION_TURN_OFF > 0)
|
||||||
call.set_transition_length(LIGHT_TRANSITION_TURN_OFF); // in ms
|
call.set_transition_length(LIGHT_TRANSITION_TURN_OFF); // in ms
|
||||||
@@ -819,12 +819,12 @@ script:
|
|||||||
case 2:
|
case 2:
|
||||||
if (light_index >= id(gb_lights_2).size()) {
|
if (light_index >= id(gb_lights_2).size()) {
|
||||||
ESP_LOGE("core_hw_leds", "Invalid set with %s light for Relay %" PRIu8,
|
ESP_LOGE("core_hw_leds", "Invalid set with %s light for Relay %" PRIu8,
|
||||||
light_mode_group_2.c_str(), light_index);
|
light_mode_group_2.c_str(), light_index+1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state and !id(gb_lights_2)[light_index]->current_values.is_on()) {
|
if (state and !id(gb_lights_2)[light_index]->current_values.is_on()) {
|
||||||
ESP_LOGI("core_hw_leds", "Turn-on %s light for Relay %" PRIu8,
|
ESP_LOGI("core_hw_leds", "Turn-on %s light for Relay %" PRIu8,
|
||||||
light_mode_group_2.c_str(), light_index);
|
light_mode_group_2.c_str(), light_index+1);
|
||||||
auto call = id(gb_lights_2)[light_index]->turn_on();
|
auto call = id(gb_lights_2)[light_index]->turn_on();
|
||||||
if (LIGHT_TRANSITION_TURN_ON > 0)
|
if (LIGHT_TRANSITION_TURN_ON > 0)
|
||||||
call.set_transition_length(LIGHT_TRANSITION_TURN_ON); // in ms
|
call.set_transition_length(LIGHT_TRANSITION_TURN_ON); // in ms
|
||||||
@@ -833,7 +833,7 @@ script:
|
|||||||
call.perform();
|
call.perform();
|
||||||
} else if (!state and id(gb_lights_2)[light_index]->current_values.is_on()) {
|
} else if (!state and id(gb_lights_2)[light_index]->current_values.is_on()) {
|
||||||
ESP_LOGI("core_hw_leds", "Turn-off %s light for Relay %" PRIu8,
|
ESP_LOGI("core_hw_leds", "Turn-off %s light for Relay %" PRIu8,
|
||||||
light_mode_group_2.c_str(), light_index);
|
light_mode_group_2.c_str(), light_index+1);
|
||||||
auto call = id(gb_lights_2)[light_index]->turn_off();
|
auto call = id(gb_lights_2)[light_index]->turn_off();
|
||||||
if (LIGHT_TRANSITION_TURN_OFF > 0)
|
if (LIGHT_TRANSITION_TURN_OFF > 0)
|
||||||
call.set_transition_length(LIGHT_TRANSITION_TURN_OFF); // in ms
|
call.set_transition_length(LIGHT_TRANSITION_TURN_OFF); // in ms
|
||||||
|
|||||||
Reference in New Issue
Block a user