From e36694c03db1f0eff4b93b6c942eacda629fae7f Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sun, 12 Apr 2020 20:13:18 +0200 Subject: [PATCH] [modules/ping] Simplify update logic --- modules/core/ping.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/core/ping.py b/modules/core/ping.py index 14ff238..c74b76b 100644 --- a/modules/core/ping.py +++ b/modules/core/ping.py @@ -47,9 +47,7 @@ def get_rtt(module, widget): except Exception as e: widget.set('rtt-unreachable', True) - if widget.get('pending'): - widget.set('pending', False) - core.event.trigger('update-modules', [ module.id ], redraw_only=True) + core.event.trigger('update', [ module.id ], redraw_only=True) class Module(core.module.Module): @core.decorators.every(seconds=60) @@ -63,11 +61,8 @@ class Module(core.module.Module): widget.set('rtt-avg', 0.0) widget.set('rtt-unit', '') widget.set('packet-loss', 0) - widget.set('pending', True) def rtt(self, widget): - if widget.get('pending') == True: - return 'pending' if widget.get('rtt-unreachable'): return '{}: unreachable'.format(widget.get('address')) return '{}: {:.1f}{} ({}%)'.format(