Skip to content

Commit d9adcd1

Browse files
author
OSi (Ondrej Sienczak)
committed
Less deghosting to save battery
1 parent 8efa82f commit d9adcd1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

esp32/micropython.bin

48 Bytes
Binary file not shown.

simulator/ui/acep/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ def repaint_welcome(self):
2626

2727
def repaint_forecast(self, volt):
2828
if self.connection is not None:
29-
with self.Drawing("weather", self):
29+
forecast = self.forecast
30+
dt = forecast.time.get_date_time(forecast.weather.dt)
31+
hour = dt[3]
32+
with self.Drawing("weather", self, hour == 3):
3033
# We have forecast, so lets draw it on screen. Don't draw
3134
# always everything as forecast is changing not so often,
3235
# but temperature is.

simulator/ui/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ def forecast_blocks(self):
137137
x2 += block
138138

139139
class Drawing:
140-
def __init__(self, name, epd):
140+
def __init__(self, name, epd, deghost=True):
141141
self.name = name
142142
self.epd = epd
143+
self.deghost = deghost
143144

144145
def __enter__(self):
145146
logger.info(f"Drawing {self.name} ...")
@@ -149,7 +150,7 @@ def __enter__(self):
149150
def __exit__(self, *args):
150151
logger.info(f"Flushing {self.name} ...")
151152
self.epd.led.mode(self.epd.led.FLUSHING)
152-
self.epd.canvas.flush()
153+
self.epd.canvas.flush(self.deghost)
153154

154155

155156
def with_forecast(fn):

0 commit comments

Comments
 (0)