Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuned-ppd: Remove the use of StrEnum #712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tuned/ppd/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from tuned.utils.commands import commands
from tuned.consts import PPD_CONFIG_FILE
from tuned.ppd.config import PPDConfig, PPD_PERFORMANCE, PPD_POWER_SAVER
from enum import StrEnum
from enum import Enum
import threading
import dbus
import os
Expand All @@ -18,7 +18,7 @@
UPOWER_DBUS_PATH = "/org/freedesktop/UPower"
UPOWER_DBUS_INTERFACE = "org.freedesktop.UPower"

class PerformanceDegraded(StrEnum):
class PerformanceDegraded(Enum):
NONE = ""
LAP_DETECTED = "lap-detected"
HIGH_OPERATING_TEMPERATURE = "high-operating-temperature"
Expand Down Expand Up @@ -128,9 +128,9 @@ def _check_performance_degraded(self):
if os.path.exists(LAP_MODE_PATH) and self._cmd.read_file(LAP_MODE_PATH).strip() == "1":
performance_degraded = PerformanceDegraded.LAP_DETECTED
if performance_degraded != self._performance_degraded:
log.info("Performance degraded: %s" % performance_degraded)
log.info("Performance degraded: %s" % performance_degraded.value)
self._performance_degraded = performance_degraded
exports.property_changed("PerformanceDegraded", performance_degraded)
exports.property_changed("PerformanceDegraded", performance_degraded.value)

def initialize(self):
self._profile_holds = ProfileHoldManager(self)
Expand Down Expand Up @@ -216,7 +216,7 @@ def get_actions(self):

@exports.property_getter("PerformanceDegraded")
def get_performance_degraded(self):
return self._performance_degraded
return self._performance_degraded.value

@exports.property_getter("ActiveProfileHolds")
def get_active_profile_holds(self):
Expand Down
Loading