From 789109e8135a41390299f1b01f899fd44ca0e90d Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 29 Dec 2019 15:34:42 -0800 Subject: [PATCH] update to include the current time when polling... helps make sure time is correct --- bin/poll.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/poll.py b/bin/poll.py index 75e71b2..e84bf92 100644 --- a/bin/poll.py +++ b/bin/poll.py @@ -41,17 +41,18 @@ if __name__ == '__main__': tzs = s = time.time() while True: usage_data = raineagle.get_usage_data(macid) + + e = time.time() + if False: print `usage_data` else: #{u'message_queue': u'active', u'threshold_lower_demand': u'-2.000000', u'fast_poll_frequency': u'0x00', u'summation_delivered': u'65374.021', u'message_read': u'Y', u'price': u'0.2700', u'demand_timestamp': u'1571842464', u'fast_poll_endtime': u'0x00000000', u'meter_status': u'Connected', u'message_confirm_required': u'N', u'message_confirmed': u'N', u'demand_units': u'kW', u'summation_units': u'kWh', u'demand': u'0.9980', u'price_units': u'840', u'message_timestamp': u'946684800', u'price_label': u'Set by User', u'threshold_upper_demand': u'9.155000', u'message_id': u'0', u'summation_received': u'0.000'} try: - print_data('l', *(usage_data[x] for x in fields)) + print_data('m', str(e), *(usage_data[x] for x in fields)) except KeyError: print_data('e', 'usage', `usage_data`) - e = time.time() - if e >= tzs: tzs += tzinterval # {u'timezone_tzName': u'GMT+7', u'timezone_status': u'success', u'timezone_localTime': u'1571844539', u'timezone_olsonName': u'Etc/GMT+7', u'timezone_utcTime': u'1571869739', u'timezone_utcOffset': u'-0700'}