diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-08-15 17:57:25 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-08-15 17:57:25 +0200 |
commit | 8e8481885d3134e8d994a30fd5254fc6d41df9ea (patch) | |
tree | fefb65fec9f438ee319d1c523ccb8e7417ee215b /daemon.py | |
parent | 137e9ac603fac87d42a9e383885827a4e769110d (diff) | |
download | turris-ups-pfc8591-0.2.tar.gz turris-ups-pfc8591-0.2.tar.bz2 turris-ups-pfc8591-0.2.zip |
Rename from i2c-collect to more suitable ups-pfc8591v0.2
Diffstat (limited to 'daemon.py')
-rwxr-xr-x | daemon.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -22,7 +22,7 @@ battery_not_high = 250 i2c = I2C("/dev/i2c-7") # Initialize sqlite -db_connection = sqlite3.connect('/tmp/i2c-collect.db') +db_connection = sqlite3.connect('/tmp/ups-pfc8591.db') db = db_connection.cursor() # Initialize ubus @@ -36,7 +36,7 @@ def read_chunk(handler, data): handler.reply({"data": result}) ubus.add( - "i2c-collect", { + "ups-pfc8591", { "read_data": { "method": read_chunk, "signature": {"range": ubus.BLOBMSG_TYPE_INT32, "field": ubus.BLOBMSG_TYPE_STRING}, @@ -73,7 +73,7 @@ def db_data(data): def ubus_data(data): date = str(int(time.time())) for k in iter(data.keys()): - ubus.send("i2c-collect", {k: (date, data[k])}) + ubus.send("ups-pfc8591", {k: (date, data[k])}) notified_power_supply = False notified_low_battery = False |