Skip to content

Commit a3df973

Browse files
committed
ftespnow: Fix code formatting errors.
Signed-off-by: Guilherme Laurindo Schneck <guilhermeschneck@gmail.com>
1 parent b7cf370 commit a3df973

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

micropython/ftespnow/ftespnow-client/ftespnow/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44

55
class CLIENT:
6-
def __init__(self, *, timeout :int = 5) -> None:
6+
def __init__(self, *, timeout: int = 5) -> None:
77
self.esp = espnow.ESPNow()
88
self.timeout = timeout
99

10-
def configure(self, *, timeout :int = 5) -> None:
10+
def configure(self, *, timeout: int = 5) -> None:
1111
self.timeout: int = timeout
1212

13-
def connect(self, peer :str) -> None:
13+
def connect(self, peer: str) -> None:
1414
self.peer: str = peer
1515
self.esp.active(True)
1616
self.esp.add_peer(self.peer)
1717

18-
def send_message(self, data :str) -> bool:
18+
def send_message(self, data: str) -> bool:
1919
"""
2020
Send a string
2121
@@ -28,10 +28,10 @@ def send_message(self, data :str) -> bool:
2828
bool: Confirmation flag (`True` if data was received, `False` otherwise)
2929
"""
3030

31-
ack :bool = self.esp.send(self.peer, data)
31+
ack: bool = self.esp.send(self.peer, data)
3232
return ack
3333

34-
def receive_message(self, recv_timeout :int = 5) -> list | None:
34+
def receive_message(self, recv_timeout: int = 5) -> list | None:
3535
"""
3636
Receive a string
3737
@@ -49,7 +49,7 @@ def receive_message(self, recv_timeout :int = 5) -> list | None:
4949
return
5050
return received
5151

52-
def send_txt(self, filename :str) -> bool:
52+
def send_txt(self, filename: str) -> bool:
5353
"""
5454
Parse and send a `.txt` file as a `string`
5555
@@ -67,7 +67,7 @@ def send_txt(self, filename :str) -> bool:
6767
sent: bool = self.send_message(data)
6868
return sent
6969

70-
def send_json(self, filename :str, *, indent :int = 4) -> bool:
70+
def send_json(self, filename: str, *, indent: int = 4) -> bool:
7171
"""
7272
Parse and send a `.json` file as a `string`
7373
@@ -88,7 +88,7 @@ def send_json(self, filename :str, *, indent :int = 4) -> bool:
8888
sent: bool = self.send_message(parsed)
8989
return sent
9090

91-
def receive_to_txt(self, target_file :str, mode :str = "a") -> bool:
91+
def receive_to_txt(self, target_file: str, mode: str = "a") -> bool:
9292
"""
9393
Write received `string` into a `.txt` file.
9494
@@ -139,7 +139,7 @@ def receive_to_txt(self, target_file :str, mode :str = "a") -> bool:
139139
except SyntaxError:
140140
raise
141141

142-
def receive_to_json(self, target_file :str, mode :str = "a") -> bool:
142+
def receive_to_json(self, target_file: str, mode: str = "a") -> bool:
143143
"""
144144
Write received `string` into a `.json` file.
145145

micropython/ftespnow/ftespnow-server/ftespnow/server.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
import json
33

44
class SERVER:
5-
def __init__(self, *, timeout :int = 5) -> None:
5+
def __init__(self, *, timeout: int = 5) -> None:
66
self.esp = espnow.ESPNow()
77
self.timeout = timeout
88

9-
def configure(self, *, timeout :int = 5) -> None:
9+
def configure(self, *, timeout: int = 5) -> None:
1010
self.timeout = timeout
1111

12-
def send_message(self, peer :str, data :str) -> bool:
12+
def send_message(self, peer: str, data: str) -> bool:
1313
"""
1414
Send a string
1515
@@ -27,7 +27,7 @@ def send_message(self, peer :str, data :str) -> bool:
2727
ack: bool = self.esp.send(peer, data)
2828
return ack
2929

30-
def receive_message(self, recv_timeout :int = 5) -> list | None:
30+
def receive_message(self, recv_timeout: int = 5) -> list | None:
3131
"""
3232
Receive a string
3333
@@ -45,7 +45,7 @@ def receive_message(self, recv_timeout :int = 5) -> list | None:
4545
return
4646
return received
4747

48-
def send_txt(self, peer :str, filename :str) -> bool:
48+
def send_txt(self, peer: str, filename: str) -> bool:
4949
"""
5050
Parse and send a `.txt` file as a `string`
5151
@@ -65,7 +65,7 @@ def send_txt(self, peer :str, filename :str) -> bool:
6565
sent: bool = self.send_message(peer, data)
6666
return sent
6767

68-
def send_json(self, peer :str, filename :str, *, indent :int = 4) -> bool:
68+
def send_json(self, peer: str, filename: str, *, indent: int = 4) -> bool:
6969
"""
7070
Parse and send a `.json` file as a `string`
7171
@@ -88,7 +88,7 @@ def send_json(self, peer :str, filename :str, *, indent :int = 4) -> bool:
8888
sent: bool = self.send_message(peer, parsed)
8989
return sent
9090

91-
def receive_to_txt(self, target_file :str, mode :str = "a") -> bool:
91+
def receive_to_txt(self, target_file: str, mode: str = "a") -> bool:
9292
"""
9393
Write received `string` into a `.txt` file.
9494
@@ -138,7 +138,7 @@ def receive_to_txt(self, target_file :str, mode :str = "a") -> bool:
138138
except SyntaxError:
139139
raise
140140

141-
def receive_to_json(self, target_file :str, mode :str = "a") -> bool:
141+
def receive_to_json(self, target_file: str, mode: str = "a") -> bool:
142142
"""
143143
Write received `string` into a `.json` file.
144144

0 commit comments

Comments
 (0)