Current UV in header

37 views
Skip to first unread message

Yotta

unread,
Jun 18, 2016, 1:30:06 AM6/18/16
to wfrog-users
Would it be difficult to include current UV index in the header?

At a brief glance I guess it needs an entry in current.yaml (and main.html).

Would something else need to be changed so that wfrog-current.xml is populated with values?

Jordi Puigsegur Figueras

unread,
Jun 21, 2016, 4:36:14 AM6/21/16
to wfrog...@googlegroups.com
You need to modify current.yaml and main.html.

wfrog-current-xml is not used by wfrender and it is not configurable.

Jordi.

--
You received this message because you are subscribed to the Google Groups "wfrog-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wfrog-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yotta

unread,
Jun 22, 2016, 2:34:28 PM6/22/16
to wfrog-users
I'm not a python programmer so just followed the format of other entries without knowing how they work.

in /etc/wfrog/wfrender/templates/default/main.html I added the line:

"UV <span class="value">$rnd($current.UV_INDEX, 1)</span><br>" after Rain in the header

and in /etc/wfrog/wfrender/config/default/current.yaml

"UV_INDEX: !value { key: UV_INDEX }" after rain

This causes a 500 error so checking In /var/log/wfrender.log: 

> ERROR [renderer.http] 'UV_INDEX;
> Traceback (most recent call last):
> (etc)
> "/usr/lib/wfrog/wfrender/renderer/value.py", line 61, in render
>     return wfcommon.units.Converter(context["units"]).convert(self.key, data[self.key][val_key])
> KeyError 'UV_INDEX'

Using as Firebird database with "UV_INDEX" as the column name

Assuming either incorrect usage in my modifications or that more changes are required?

Jordi Puigsegur Figueras

unread,
Jun 25, 2016, 10:28:39 AM6/25/16
to wfrog...@googlegroups.com
Hi,

I'd say that everything is OK but UV_INDEX should be in lower case.

Jordi.

--

Yotta

unread,
Jun 28, 2016, 1:25:44 PM6/28/16
to wfrog-users
Changing 'uv_index' to lower case did not change the error.

The log file is pointing towards "value.py" (see traceback above).

Does 'current.yaml' interact with value.py in the process of getting the latest values?
Reply all
Reply to author
Forward
0 new messages