Skip to content

Commit

Permalink
make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
9gel authored and ppaeps committed Jun 28, 2024
1 parent 34544e3 commit 493a381
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dsl_buttons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
unlock_max_time = 3600 # max unlock is 1 hour


def button():
def button() -> None:
keepopen = False
lastopen = 0
while True:
Expand Down Expand Up @@ -54,7 +54,7 @@ def button():
r.publish("door_action", "OPEN")


async def doorlight():
async def doorlight() -> None:
lighton = p.value == 1
try:
while True:
Expand All @@ -70,16 +70,17 @@ async def doorlight():
print("doorlight done", flush=True)


async def runall():
async def runall() -> None:
t_button = asyncio.create_task(asyncio.to_thread(button))
t_doorlight = asyncio.create_task(doorlight())
await t_button
await t_doorlight


def main():
def main() -> int:
print("dsl_buttons running", flush=True)
asyncio.run(runall())
return 0


if __name__ == "__main__":
Expand Down

0 comments on commit 493a381

Please sign in to comment.