pwnagotchi-plugins-contrib/screen_refresh.py
Simone Margaritelli a213b1cd7e first commit
2019-11-07 10:58:54 +01:00

24 lines
693 B
Python

import logging
import pwnagotchi.plugins as plugins
class ScreenRefresh(plugins.Plugin):
__author__ = 'pwnagotchi [at] rossmarks [dot] uk'
__version__ = '1.0.0'
__license__ = 'GPL3'
__description__ = 'Refresh he e-ink display after X amount of updates'
def __init__(self):
self.update_count = 0;
def on_loaded(self):
logging.info("Screen refresh plugin loaded")
def on_ui_update(self, ui):
self.update_count += 1
if self.update_count == self.options['refresh_interval']:
ui.init_display()
ui.set('status', "Screen cleaned")
logging.info("Screen refreshing")
self.update_count = 0