fix inaccurate sensor startup sleep

This commit is contained in:
simon 2022-10-23 16:35:01 +07:00
parent 3e7b46e015
commit 17eed21eb3
Signed by: simon
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,9 @@ class SDS:
def startup(self):
"""activate and set mode"""
self.pm.active = 1
sleep(0.5)
while self.pm.active.get("value") != 1:
sleep(0.5)
self.pm.mode = simple_sds011.MODE_PASSIVE
print("warm up sensor")
sleep(20)