Skip to content

Commit 2528d65

Browse files
committed
added clear function
updated get_fonts to return list instead of printing updated get_mode to return mode correctly
1 parent 528f010 commit 2528d65

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
@@ -44,6 +44,10 @@ def __init__(self, baseURL: str, width: int = 115, height: int = 16, flipped: bo
4444
def set_url(self, url: str):
4545
self.baseURL = url
4646

47+
def clear(self, inverted: bool = False) -> None:
48+
self.post_frame([[inverted]*115]*16)
49+
50+
4751
def post_time(self) -> None:
4852
import datetime
4953
dt: str = ""
@@ -73,14 +77,14 @@ def get_pixel(self, x: int = 0, y: int = 0) -> bool | None:
7377
rtn = True if r.text == "X" else False if r.text == " " else None
7478
return rtn
7579

76-
def get_fonts(self) -> None:
80+
def get_fonts(self) -> list[str]:
7781
r = self._get(fontURL)
78-
fonts = r.text.split("\n")
79-
print(fonts)
82+
return r.text.split("\n")
8083

8184
def get_mode(self) -> Mode:
8285
r = self._get(modeURL)
83-
return Mode(int(r.text))
86+
text = r.text.split("\n")[0]
87+
return Mode(int(text))
8488

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

0 commit comments

Comments
 (0)