mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-22 01:00:02 +02:00
fixes number slider constructor
This commit is contained in:
parent
c891642bda
commit
a7ec7c1536
@ -46,6 +46,7 @@ class NumberSlider(DataService):
|
||||
step_size: float = 1.0,
|
||||
type_: Literal["int", "float"] = "float",
|
||||
) -> None:
|
||||
super().__init__()
|
||||
if type_ not in {"float", "int"}:
|
||||
logger.error("Unknown type '%s'. Using 'float'.", type_)
|
||||
type_ = "float"
|
||||
@ -56,8 +57,6 @@ class NumberSlider(DataService):
|
||||
self.min = min_
|
||||
self.max = max_
|
||||
|
||||
super().__init__()
|
||||
|
||||
def __setattr__(self, name: str, value: Any) -> None:
|
||||
if name in ["value", "step_size"]:
|
||||
value = int(value) if self._type == "int" else float(value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user