From 61e0c4a5f57b8a19951268301cd0f7b9e0aa068d Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Fri, 15 Apr 2016 17:33:12 -0500 Subject: [PATCH] val was used before assigned --- python/tag_mysql.py | 2 +- python/tag_sqlite.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tag_mysql.py b/python/tag_mysql.py index 7263b66..9a7bcee 100644 --- a/python/tag_mysql.py +++ b/python/tag_mysql.py @@ -55,8 +55,8 @@ class Tag(): if self.tag: v = self.readFn(self.ip_address, self.tag) if v: + val = v[0] if self.data_type == 'BOOL' or self.data_type == 'STRING': - val = v[0] if self.mapFn: val = self.mapFn[val] if (self.last_send_time == 0) or (self.value is None) or not (self.value == val) or ((time.time() - self.last_send_time) > self.guarantee_sec) or (forceSend == True): diff --git a/python/tag_sqlite.py b/python/tag_sqlite.py index bf1112a..457cd94 100644 --- a/python/tag_sqlite.py +++ b/python/tag_sqlite.py @@ -51,8 +51,8 @@ class Tag(): if self.tag: v = self.readFn(str(self.ip_address), str(self.tag)) if v: + val = v[0] if self.data_type == 'BOOL' or self.data_type == 'STRING': - val = v[0] if self.mapFn: val = self.mapFn[val] if (self.last_send_time == 0) or (self.value is None) or not (self.value == val) or ((time.time() - self.last_send_time) > self.guarantee_sec) or (forceSend == True):