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