aboutsummaryrefslogtreecommitdiffstats
path: root/slack
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-10-15 16:07:49 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:54 +0100
commit35bc2e98583d3e04e9310ea3950549f64da7fb6d (patch)
tree5c7c7e80c6e1a6fa4f9e308216ad00f9532369a5 /slack
parent094868a40f22aa09b412ef8db4ea2eb885433e0c (diff)
downloadwee-slack-35bc2e98583d3e04e9310ea3950549f64da7fb6d.tar.gz
Fix bug with setting bool config values
Diffstat (limited to 'slack')
-rw-r--r--slack/weechat_config.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/slack/weechat_config.py b/slack/weechat_config.py
index 6e6cb85..9c0c098 100644
--- a/slack/weechat_config.py
+++ b/slack/weechat_config.py
@@ -102,9 +102,12 @@ class WeeChatOption(Generic[WeeChatOptionType]):
@value.setter
def value(self, value: WeeChatOptionType):
- rc = self.value_set_as_str(str(value))
+ value_str = (
+ str(value).lower() if isinstance(self.default_value, bool) else str(value)
+ )
+ rc = self.value_set_as_str(value_str)
if rc == weechat.WEECHAT_CONFIG_OPTION_SET_ERROR:
- raise Exception(f"Failed to value for option: {self.name}")
+ raise Exception(f"Failed to set value for option: {self.name}")
def value_set_as_str(self, value: str) -> int:
return weechat.config_option_set(self._pointer, value, 1)