Re: [weewx-development] Format of weewx-variables/datafields for arithmetic (service development)?

2024-05-04 Thread Joel Bion
I guess this is as good a time as any to ask if None is the way Weewx represents a nonexistent element of data for the result of a query to any of its API functions. For example, if I want the barometric pressure at 9am, and no pressure was recorded around that time, is it None that would be

Re: [weewx-development] Format of weewx-variables/datafields for arithmetic (service development)?

2024-05-04 Thread Michael Frotscher
Admittedly more elegant, thanks! Like I said, I'm still getting into Python, so I wasn't aware one could apply get() here. I usually have a fair understanding of what code does and can generate pseudocode of what I want, but implementing that in proper Python code is what I struggle with. On

Re: [weewx-development] Format of weewx-variables/datafields for arithmetic (service development)?

2024-05-04 Thread Tom Keffer
Or, combining into one step... if event.record.get('rain') is not None: do something On Sat, May 4, 2024 at 11:58 AM Michael Frotscher wrote: > That did it, thanks, Frantisek! > I now check that if 'rain' is in event.record, then check if it is > non-Null, and if those two conditions are

Re: [weewx-development] Format of weewx-variables/datafields for arithmetic (service development)?

2024-05-04 Thread Michael Frotscher
That did it, thanks, Frantisek! I now check that if 'rain' is in event.record, then check if it is non-Null, and if those two conditions are true, 'rain' has a valid value and I can use it for arithmetic. On Saturday, May 4, 2024 at 4:17:10 AM UTC-5 František Slimařík wrote: > Hello, > >

Re: [weewx-development] rsync_path

2024-05-04 Thread Tom Keffer
V5.1 will have a feature that allows any arbitrary rsync command option to be specified. See issue #951 . On Fri, May 3, 2024 at 10:15 PM Clay Jackson wrote: > My ISP does not support rsync as a standard; but does allow users to use > their own copy.

Re: [weewx-development] Format of weewx-variables/datafields for arithmetic (service development)?

2024-05-04 Thread František Slimařík
Hello, event.record is dictionary. If you do event.record["rain" ] = something you add new key/value into dictionary (if doesn´t exists or overwrite current value). In case packet doesn´t contain no value for rain, key/value pair is not added. If you do something and you are not sure if key exist