don't print duplicate status line

This commit is contained in:
Eric House 2023-12-20 12:06:28 -08:00
parent e2414ff3bd
commit 713ce151e9

View file

@ -482,18 +482,14 @@ class Device():
print()
GameStatus.makeAll()
lines = []
for line in range(GameStatus.numLines()):
txt = GameStatus.line(line)
print(txt)
lines.append(txt)
lines = [GameStatus.line(ii) for ii in range(GameStatus.numLines())]
now = datetime.datetime.now()
if not lines == GameStatus._prevLines:
if lines == GameStatus._prevLines:
print('no change in {}'.format(now - GameStatus._lastChange))
else:
for line in lines: print(line)
GameStatus._prevLines = lines
GameStatus._lastChange = now
else:
print('no change in {}'.format(now - GameStatus._lastChange))
@staticmethod
def deviceFor(args, host):