1
0
Fork 0

Merge pull request #727 from zacikpa/hold-clearing-fix

tuned-ppd: Fix handling of profile change signals from TuneD
This commit is contained in:
Jaroslav Škarvada 2025-01-18 19:56:04 +01:00 committed by GitHub
commit 0b82ce0c9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -249,7 +249,9 @@ class Controller(exports.interfaces.ExportableInterface):
"""
if not result:
return
self._profile_holds.clear()
if tuned_profile != self._tuned_interface.active_profile():
log.debug("Received a profile change signal from TuneD, but it is not relevant anymore.")
return
try:
ppd_profile = self._config.tuned_to_ppd.get(tuned_profile, self._on_battery)
except KeyError:
@ -257,6 +259,7 @@ class Controller(exports.interfaces.ExportableInterface):
log.warning("TuneD profile changed to an unknown profile '%s'" % tuned_profile)
if self._active_profile != ppd_profile:
log.info("Profile changed to '%s'" % ppd_profile)
self._profile_holds.clear()
self._active_profile = ppd_profile
exports.property_changed("ActiveProfile", self._active_profile)
if ppd_profile != UNKNOWN_PROFILE: