Skip to content

Commit 527c0a1

Browse files
committed
fix: x, y Expect integer
1 parent 6751582 commit 527c0a1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hmdriver2/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _to_abs_pos(self, x: Union[int, float], y: Union[int, float]) -> Point:
255255
x = int(w * x)
256256
if y < 1:
257257
y = int(h * y)
258-
return Point(x, y)
258+
return Point(int(x), int(y))
259259

260260
@delay
261261
def click(self, x: Union[int, float], y: Union[int, float]):

hmdriver2/hdc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def list_devices() -> List[str]:
3939
if result.exit_code == 0 and result.output:
4040
lines = result.output.strip().split('\n')
4141
for line in lines:
42+
if line.__contains__('Empty'):
43+
continue
4244
devices.append(line.strip())
4345
return devices
4446

0 commit comments

Comments
 (0)