This commit is contained in:
e2002
2023-03-29 09:41:11 +03:00
parent 212f7ab102
commit 9435191126
4 changed files with 7 additions and 3 deletions

View File

@@ -52,6 +52,7 @@ void ticks() {
void Network::WiFiReconnected(WiFiEvent_t event, WiFiEventInfo_t info){
network.beginReconnect = false;
player.lockOutput = false;
delay(100);
display.putRequest(NEWMODE, PLAYER);
if (network.lostPlaying) player.sendCommand({PR_PLAY, config.store.lastStation});
@@ -64,7 +65,7 @@ void Network::WiFiLostConnection(WiFiEvent_t event, WiFiEventInfo_t info){
if(!network.beginReconnect){
Serial.println("Lost connection, reconnecting...");
network.lostPlaying = player.isRunning();
if (network.lostPlaying) { player.sendCommand({PR_STOP, 0}); }
if (network.lostPlaying) { player.lockOutput = true; player.sendCommand({PR_STOP, 0}); }
display.putRequest(NEWMODE, LOST);
}
network.beginReconnect = true;

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define YOVERSION "0.9.141"
#define YOVERSION "0.9.142"
/*******************************************************
DO NOT EDIT THIS FILE.

View File

@@ -102,7 +102,7 @@ void Player::_stop(bool alreadyStopped){
display.putRequest(PSTOP);
setDefaults();
if(!alreadyStopped) stopSong();
stopInfo();
if(!lockOutput) stopInfo();
if (player_on_stop_play) player_on_stop_play();
}