Skip to content

Commit f414360

Browse files
committed
added clear function
updated get_fonts to return list instead of printing updated get_mode to return mode correctly
1 parent 0a1417e commit f414360

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/fluepdot/fluepdot.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def __init__(self, baseURL: str, width: int = 115, height: int = 16, flipped: bo
4040
def set_url(self, url: str):
4141
self.baseURL = url
4242

43+
def clear(self, inverted: bool = False) -> None:
44+
self.post_frame([[inverted]*115]*16)
45+
46+
4347
def post_time(self) -> None:
4448
import datetime
4549
dt: str = ""
@@ -69,14 +73,14 @@ def get_pixel(self, x: int = 0, y: int = 0) -> bool | None:
6973
rtn = True if r.text == "X" else False if r.text == " " else None
7074
return rtn
7175

72-
def get_fonts(self) -> None:
76+
def get_fonts(self) -> list[str]:
7377
r = self._get(fontURL)
74-
fonts = r.text.split("\n")
75-
print(fonts)
78+
return r.text.split("\n")
7679

7780
def get_mode(self) -> Mode:
7881
r = self._get(modeURL)
79-
return Mode(int(r.text))
82+
text = r.text.split("\n")[0]
83+
return Mode(int(text))
8084

8185
def post_text(self, text: str, x: int = 0, y: int = 0, font: str = "DejaVuSans12") -> Response:
8286
if self.flipped:

0 commit comments

Comments
 (0)