default information

This commit is contained in:
Robert Borzutzki 2022-10-19 09:21:28 +02:00
parent 43dcf57baf
commit 0f4234ab6c

View File

@ -19,6 +19,39 @@ logging.basicConfig(level=logging.DEBUG)
Connected = False Connected = False
try:
logging.info("epd2in13bc Demo")
epd = epd2in13bc.EPD()
logging.info("init and Clear")
epd.init()
epd.Clear()
time.sleep(1)
# Drawing on the image
logging.info("Drawing")
font18 = ImageFont.truetype(os.path.join(picdir, 'Font.ttc'), 18)
# Drawing on the Horizontal image
logging.info("1.Drawing on the Horizontal image...")
HBlackimage = Image.new('1', (epd.height, epd.width), 255) # 298*126
HRYimage = Image.new('1', (epd.height, epd.width), 255) # 298*126 ryimage: red or yellow image
drawblack = ImageDraw.Draw(HBlackimage)
drawry = ImageDraw.Draw(HRYimage)
drawblack.text((10, 0), 'PV Produktion', font = font18, fill = 0)
drawblack.text((10, 20), 'Hausverbrauch', font = font18, fill = 0)
drawblack.text((10, 40), 'Strom Import/Export', font = font18, fill = 0)
drawblack.text((10, 60), 'Batterie %', font = font18, fill = 0)
drawblack.text((10, 80), 'Batterie Laden/Entladen', font = font18, fill = 0)
except IOError as e:
logging.info(e)
except KeyboardInterrupt:
logging.info("ctrl + c:")
epd2in13bc.epdconfig.module_exit()
exit()
def on_connect(client, userdata, flags, rc): def on_connect(client, userdata, flags, rc):
if rc == 0: if rc == 0: