To show a value for yesterday, the value would have to be in the database.

On Sun, Feb 14, 2021 at 10:29 AM Karen K <kk4468...@gmail.com> wrote:

> Oh, so I mixed it up some way. I registered the XType as a service.
>
> Now there are two different classes, and that looks a lot better. The
> extension calculates the values and draws a graph. Thank you for your
> advice. It saved a lot of time.
>
> $current.GTS displays a value now. $day.GTS and $yesterday.GTS do not.
>
> Tom Keffer schrieb am Samstag, 13. Februar 2021 um 23:37:58 UTC+1:
>
>> Good start!
>>
>> I can see a few issues here.
>>
>> 1. All xtype extensions must be registered, otherwise the system has no
>> way of knowing of their existence. See the section *Registering your
>> subclass
>> <https://github.com/weewx/weewx/wiki/WeeWX-V4-user-defined-types#registering-your-subclass>*
>>  for
>> how to register your xtype.
>>
>> 2. From what I can tell, your extension only returns a value for
>> 'GTSdate', never for 'GTS'.
>>
>> 3. I don't quite follow the logic of the loop in get_scalar(), but it
>> looks like it is trying to keep a running total of something. Just a
>> warning: this could be very inefficient because an xtype can potentially
>> get called many times in a template. Would it be possible to refactor into
>> a database query?
>>
>>
>>
>> On Sat, Feb 13, 2021 at 1:05 PM Karen K <kk44...@gmail.com> wrote:
>>
>>> And the cheetah generator's result is
>>>
>>> Karen K schrieb am Samstag, 13. Februar 2021 um 22:04:36 UTC+1:
>>>
>>>> test skin index.html.tmpl
>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "weewx-development" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to weewx-developm...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-development/1f9090b4-308a-4029-9d84-fcfba0229171n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/weewx-development/1f9090b4-308a-4029-9d84-fcfba0229171n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-development+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-development/09de8f6e-1063-492f-8b4b-add16d6d78den%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-development/09de8f6e-1063-492f-8b4b-add16d6d78den%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

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

Reply via email to