From 341dfee18197121903bfaf16d447fec2fe9cf04a Mon Sep 17 00:00:00 2001 From: Colin Moller Date: Mon, 21 Sep 2015 11:02:20 -0700 Subject: [PATCH] Configs need to be strings, and initial state of notification state should be epoch so the first one always makes it through --- weebullet.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/weebullet.py b/weebullet.py index 01e3645..cfce907 100644 --- a/weebullet.py +++ b/weebullet.py @@ -37,14 +37,14 @@ w.hook_command( ) configs = { "api_key": REQUIRED, - "away_only": "1", # only send when away - "device_iden": "all", # send to all devices - "ignored_channels": "", # no ignored channels - "min_notify_interval": 0, # seconds, don't notify more often than this - "debug": 0, # enable debugging + "away_only": "1", # only send when away + "device_iden": "all", # send to all devices + "ignored_channels": "", # no ignored channels + "min_notify_interval": "0", # seconds, don't notify more often than this + "debug": "0", # enable debugging } -last_notification = None +last_notification = 0 # 0 seconds from the epoch for option, default_value in configs.items(): if w.config_get_plugin(option) == "": @@ -61,7 +61,7 @@ for option, default_value in configs.items(): def debug(msg): - if w.config_get_plugin("debug") is not 0: + if str(w.config_get_plugin("debug")) is not "0": w.prnt("", "[weebullet] DEBUG: %s" % str(msg)) def process_devicelist_cb(data, url, status, response, err):