Merge pull request #727 from zacikpa/hold-clearing-fix
tuned-ppd: Fix handling of profile change signals from TuneD
This commit is contained in:
commit
0b82ce0c9b
1 changed files with 4 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue