Przeglądaj źródła

Merge pull request #2 from kristin0512/fix-minitouch-pressure-range

Fix minitouch pressure range for low max_pressure
blylana 1 tydzień temu
rodzic
commit
41753016e5
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      module/device/method/minitouch.py

+ 2 - 2
module/device/method/minitouch.py

@@ -411,7 +411,7 @@ class Minitouch(Connection):
 
 
     def _humanized_pressure(self) -> int:
     def _humanized_pressure(self) -> int:
         top = getattr(self, 'max_pressure', 100) or 100
         top = getattr(self, 'max_pressure', 100) or 100
-        return random.randint(max(20, top // 2), top)
+        return random.randint(max(1, top // 2), top)
 
 
     def _humanized_dwell(self) -> int:
     def _humanized_dwell(self) -> int:
         return int(random.triangular(45, 130, 65))
         return int(random.triangular(45, 130, 65))
@@ -634,4 +634,4 @@ class Minitouch(Connection):
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     mm = Minitouch(config='oas1')
     mm = Minitouch(config='oas1')
-    mm.click_minitouch(200, 150)
+    mm.click_minitouch(200, 150)