From b8d94b271f805e159b20272e925acfce506268cd Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Sun, 24 Dec 2023 01:47:57 +0100 Subject: [PATCH] fix slider config cast --- controldeck.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/controldeck.py b/controldeck.py index 1eabf5c..697cf77 100755 --- a/controldeck.py +++ b/controldeck.py @@ -280,9 +280,12 @@ class Slider(Div): self.command = '' # command to run on click self.state_command = '' # command to check the current state - self.min = float(kwargs.pop('min', 0)) - self.max = float(kwargs.pop('max', 100)) - self.step = float(kwargs.pop('step', 1)) + self.min = kwargs.pop('min', '0') + self.min = float(self.min) if self.min else 0 + self.max = kwargs.pop('max', '100') + self.max = float(self.max) if self.max else 100 + self.step = kwargs.pop('step', '1') + self.step = float(self.step) if self.step else 1 super().__init__(**kwargs) self.icon = self.icon if self.icon else 'tune' self.style = "width:286px;" # three buttons and the two spaces