mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
execute dce_init before transition to state to sync
This commit is contained in:
parent
8d5d0aaf71
commit
0c55dbb7a4
1 changed files with 10 additions and 2 deletions
|
@ -112,7 +112,6 @@ void ModemComponent::loop() {
|
||||||
this->set_state(ModemComponentState::TURNING_ON_POWER);
|
this->set_state(ModemComponentState::TURNING_ON_POWER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this->dce_init();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// The state releases the power key
|
// The state releases the power key
|
||||||
|
@ -133,7 +132,6 @@ void ModemComponent::loop() {
|
||||||
this->set_state(ModemComponentState::TURNING_OFF_POWER);
|
this->set_state(ModemComponentState::TURNING_OFF_POWER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this->dce_init();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// The state of the end of the reset of the modem
|
// The state of the end of the reset of the modem
|
||||||
|
@ -233,6 +231,16 @@ bool ModemComponent::check_modem_component_state_timings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemComponent::set_state(ModemComponentState state) {
|
void ModemComponent::set_state(ModemComponentState state) {
|
||||||
|
// execute before transition to state
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case ModemComponentState::SYNC:
|
||||||
|
this->dce_init();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
ESP_LOGCONFIG(TAG, "Modem component change state from %s to %s", this->state_to_string(this->state_),
|
ESP_LOGCONFIG(TAG, "Modem component change state from %s to %s", this->state_to_string(this->state_),
|
||||||
this->state_to_string(state));
|
this->state_to_string(state));
|
||||||
this->state_ = state;
|
this->state_ = state;
|
||||||
|
|
Loading…
Reference in a new issue