forked from ColdHeat/nycts-unit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomtext.py
More file actions
26 lines (21 loc) · 800 Bytes
/
customtext.py
File metadata and controls
26 lines (21 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import threading
import time
import urllib
import json
import urllib2
import Image
import ImageDraw
import constants
import logs
class customtext:
def __init__(self, base):
self.base = base
self.config = base.config
def draw(self):
self.config = self.base.config
image = Image.new('RGB', (constants.width, constants.height))
draw = ImageDraw.Draw(image)
draw.text((2, 0), self.config["customtext"]["line_1"].encode('latin-1', 'ignore') + " ", font=constants.font, fill=constants.red)
draw.text((2, 16), self.config["customtext"]["line_2"].encode('latin-1', 'ignore') + " " , font=constants.font, fill=constants.blue)
self.base.matrix.SetImage(image, 0, 0)
time.sleep(self.base.getTransitionTime())