On my powered speaker, it has Airplay and Spotify Connect.
It says in the speaker manual:
"During use of AirPlay… input, if no music is played or this unit’s controls are not operated for 20 minutes or more, the unit’s power will automatically be switched OFF."
Nice energy saving feature.
When I play from Airplay, if the signal stops (shut off iOS device, hit pause, etc.), after 20 minutes, the speaker goes to sleep mode (or off - depending on how it is set up by user). That is an energy conservation feature. Also nice at night before sleep as the speaker is across room.
Spotify Connect does not have a similar energy saving feature. Nor could it ever have it.
This is because the music playing is handed off to a chip in the speaker. If the music is playing, you can leave town, shut off your mobile device, and it keeps playing from the internet connected speaker until the playlist runs out or the internet connection/Wi-Fi to speaker fails.
So, if you want to auto shut off a portable speaker that has that ability, play music in Airplay from iOS instead of Spotify Connect. Handy like just before bed and the speaker is too far away to manually power off. Reserve Spotify Connect for parties, etc. where you set it and walk away.
Maybe Android does this auto shut off too but, I don't use it.