aboutsummaryrefslogtreecommitdiff
path: root/foris/__init__.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 /foris/__init__.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 'foris/__init__.py')
-rw-r--r--foris/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/foris/__init__.py b/foris/__init__.py
index a70f760..8eff4ce 100644
--- a/foris/__init__.py
+++ b/foris/__init__.py
@@ -14,7 +14,7 @@ class SamplePluginConfigHandler(BaseConfigHandler):
class SamplePluginPage(ConfigPageMixin, SamplePluginConfigHandler):
menu_order = 70
- template = "i2c_collect/i2c_collect.tpl"
+ template = "ups_pfc8591/ups_pfc8591.tpl"
userfriendly_title = gettext("I2C collect")
def _prepare_render_args(self, args):
@@ -24,7 +24,7 @@ class SamplePluginPage(ConfigPageMixin, SamplePluginConfigHandler):
args['PLUGIN_DYNAMIC_SCRIPTS'] = SamplePluginPlugin.PLUGIN_DYNAMIC_SCRIPTS
args['data'] = {}
for fld in ["voltage", "light", "temperature", "trimmer"]:
- args['data'][fld] = ubus_call("i2c-collect", "read_data", {"range": 172800, "field": fld})[0]['data']
+ args['data'][fld] = ubus_call("ups-pfc8591", "read_data", {"range": 172800, "field": fld})[0]['data']
for _, dt in enumerate(args['data'][fld]):
dt[0] = time.strftime('%H:%M:%S', time.gmtime(int(dt[0])))
if fld == "voltage":
@@ -42,7 +42,7 @@ class SamplePluginPage(ConfigPageMixin, SamplePluginConfigHandler):
class SamplePluginPlugin(ForisPlugin):
- PLUGIN_NAME = "i2c_collect"
+ PLUGIN_NAME = "ups_pfc8591"
DIRNAME = os.path.dirname(os.path.abspath(__file__))
PLUGIN_STYLES = [
@@ -51,9 +51,9 @@ class SamplePluginPlugin(ForisPlugin):
"js/Chart.bundle.min.js"
]
PLUGIN_DYNAMIC_SCRIPTS = [
- "i2c_collect.js"
+ "ups_pfc8591.js"
]
def __init__(self, app):
super(SamplePluginPlugin, self).__init__(app)
- add_config_page("i2c_collect", SamplePluginPage, top_level=True)
+ add_config_page("ups_pfc8591", SamplePluginPage, top_level=True)