That's great! Thanks for the information! So I don't see much more to say, any opinions about the code? I'm a noob in python and may have missed some important stuff.
So far I was considering to clear the "receive buffer" right after data = self.receive_buffer Then if a mqtt message arrives during the processing of loop packet, it will be processed on next loop. Also I think poll interval does not mean so much now, it should be smaller than the quicker sensor to avoid missing some data. And at the end, loop packet rate will more or less follows the quickest sensor. Best regards, Le 12 mars 2017 11:49 AM, "Wysiwyg" <[email protected]> a écrit : > Hi, > > I have a question: > > If I use a mqtt topic that does not exist in label_map, it will anyway put > it in the LOOP packet. > > For example, I tried to publish a mqtt "weewx/baro" with 1015 inside > I get it in the LOOP like this: > > LOOP: 2017-03-12 11:41:15 CET (1489315275) altimeter: None, appTemp: > None, baro: 1015.0, barometer: None, cloudbase: None, dateTime: > 1489315275, dewpoint: None, heatindex: None, humidex: None, inDewpoint: > None, maxSolarRad: None, pressure: None, rainRate: 0, usUnits: 1, > windchill: None > > > This has no meaning and I guess it would be better to filter. > also it may happens that some mqtt topics may be not for weewx but for > other personnal use. > > I would like to check if a key is existing in weewx schema before put it > in the packet, but no clue how to do that. > > I mean, as far as I understood, it's easy to check if a key exist in > dictionnary : > > if 'key1' in dict.keys(): > > > But what's the name of the weewx expected dictionnary? (I assume it may > exist a dictionnary matching the database schema? > > Best regards, > > > > >
