That's a novel use of xtypes, but I'm not sure it's always a good idea. In
this case, I think you'd be better off simply adding the type to the LOOP
packet or archive record.

The intended purpose of xtypes is to calculate derived variables. It's
entirely possible it could be called many times during a reporting cycle,
depending on the template used. Something involving I/O could be very
expensive.

Having said that, xtypes also do database accesses, which can also be very
expensive, so my advice is inconsistent. So, not saying never do it, but
think it through.

-tk

On Sun, Dec 27, 2020 at 3:44 PM Graham Eddy <graham.e...@gmail.com> wrote:

> an alternative to repurposing an existing data_type is to define an xtype
> (e.g. see https://github.com/g-eddy/weewx-vitalstats)
>
> On 28 Dec 2020, at 9:05 am, Kevin Chapman <kdchap...@gmail.com> wrote:
>
> Thank you.  I will check it out.
>
> On Sun, Dec 27, 2020 at 6:00 AM Mike Revitt <m...@cougar.eu.com> wrote:
>
>> Sorry it has taken so long to respond to this, but I have just finished
>> documenting how I added the CPU Temperature to my website, this is all
>> documented here
>> <https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/read-cpu-temp.html>
>>
>> https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/read-cpu-temp.html
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/6B658B72-0127-4CA6-BC85-60A52CB0A9E7%40gmail.com
> <https://groups.google.com/d/msgid/weewx-user/6B658B72-0127-4CA6-BC85-60A52CB0A9E7%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEC0O72sOpRhZE6b1vZ%3DxrW725Hr0XrsK%3DXAsjryejj9sQ%40mail.gmail.com.

Reply via email to