diff --git a/tests/test_step.py b/tests/test_step.py index da690ccb..f720a431 100644 --- a/tests/test_step.py +++ b/tests/test_step.py @@ -9,6 +9,7 @@ def test_step(server, s22): vis.extend(s22) assert vis.step == 0 + assert isinstance(vis.step, int) assert len(vis) == 22 @@ -23,3 +24,4 @@ def test_step(server, s22): vis.step = 5 assert vis.step == 5 + assert isinstance(vis.step, int) diff --git a/zndraw/zndraw.py b/zndraw/zndraw.py index 3a803a72..127a4a31 100644 --- a/zndraw/zndraw.py +++ b/zndraw/zndraw.py @@ -419,9 +419,11 @@ def selection(self, value: list[int]): @property def step(self) -> int: try: - return znsocket.Dict( - self.r, f"room:{self.token}:step", socket=self._refresh_client - )["grp-0"] + return int( + znsocket.Dict( + self.r, f"room:{self.token}:step", socket=self._refresh_client + )["grp-0"] + ) except KeyError: return 0