Skip to content

Commit

Permalink
In config make booleans checks with saved value non case sensitive
Browse files Browse the repository at this point in the history
It could be that in the setting file we have "true" and then this string
is compared with "True" that indicates that value was changed. By making
boolean compatisions non case sensitive this is resolved.
  • Loading branch information
Littlesat committed Aug 5, 2024
1 parent e00d03c commit 39adf7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/python/Components/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,11 @@ def trueValues(self):
# This should be set in the __init__() but has been done this way as a workaround for a stupid broken plugin that fails to call ConfigBoolean.__init__().
return ("1", "enable", "on", "true", "yes")

def isChanged(self):
#Make booleans checks with saved value non case sensitive
sv = self.saved_value or self.tostring(self.default)
strv = self.tostring(self.value)
return strv.lower() != sv.lower()

class ConfigEnableDisable(ConfigBoolean):
def __init__(self, default=False, graphic=True):
Expand Down

0 comments on commit 39adf7f

Please sign in to comment.