Tom,
I know I am on the fringe (or beyond it) of doing supported things, so I really appreciate your patience.
First, I am using $current with a data_binding because I have multiple databases. Noting that $current would do the lookup, this was just me being lazy (or it maybe at the time I felt it was more consistent for every observation to use $current). As I noted, I can easily use $latest for the xtype and its dependencies.
Second, I am not actually using $current. Because of the way cheetah processes ‘dynamic’ templates, I have moved much of the javascript generation into pure python. So, I am interacting with WeeWX ‘tag’ code directly from python. Hence my note about not fully supported.
Thirdly, I am using John Kline’s AQI xtype (
https://github.com/chaunceygardiner/weewx-airlink). I only wanted the xtype (I don’t have an airlink), so I wrote a service to just load the xtype. Again, I know I am off the support path.
After writing all this, I realize that I should just $latest(or its equivalent). I don’t think there is a good solution for WeeWX or the AQI xtype to handle this case. I am fine with the xtype expecting the dependency to be in the record. It doesn’t know it is being called in the ‘current context’, so a db lookup to get the latest seems ‘wrong’. I guess if a data_binding is passed into CurrentObj, WeeWX could pass the db record into the xtype system. But really the skin developer could just use $latest.
I just wanted to note that there are some complexities/intricacies with xtypes and $current and hopefully save someone some time.
Lastly, thanks again to you, Matthew, Gary, and everyone that has contributed to WeeWX. It says a lot about its design and implementation that I can ‘abuse’ it. And thanks for the great support.
rich