aboutsummaryrefslogtreecommitdiff
path: root/daemon.py
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-08-15 17:57:25 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-08-15 17:57:25 +0200
commit8e8481885d3134e8d994a30fd5254fc6d41df9ea (patch)
treefefb65fec9f438ee319d1c523ccb8e7417ee215b /daemon.py
parent137e9ac603fac87d42a9e383885827a4e769110d (diff)
downloadturris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.tar.gz
turris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.tar.bz2
turris-ups-pfc8591-8e8481885d3134e8d994a30fd5254fc6d41df9ea.zip
Rename from i2c-collect to more suitable ups-pfc8591v0.2
Diffstat (limited to 'daemon.py')
-rwxr-xr-xdaemon.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon.py b/daemon.py
index dfa9bfa..5fb966f 100755
--- a/daemon.py
+++ b/daemon.py
@@ -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