Just a quick update. I’m happy with this approach, but eventually V1 API support will be removed. Ideally this will be long after V1 clients are gone. But, I’ve been burnt once…. So, I’m implementing the approach below. I’m going to use the factory pattern. I already had a class ‘wrapping’ paho mqtt. I will now have a base class that implements all of the logic. I will have subclasses as necessary for the different versions of paho mqtt. These subclasses will interact with paho mqtt and pass data to the base class to do the real work. I’ll have a factory to provide the appropriate class to interact with paho mqtt. Hopefully this will insulate a bit from breaking changes, or at least make it easier to react to them. rich
On Sunday 11 February 2024 at 16:49:25 UTC-5 bell...@gmail.com wrote: > I've pretty much settled on this approach. Minimally tested > > try: > callback_api_version = mqtt.CallbackAPIVersion.VERSION1 > self.client = > mqtt.Client(callback_api_version=callback_api_version, > client_id=mqtt_options['clientid'], > userdata=self.userdata, > > clean_session=mqtt_options['clean_session']) > except AttributeError: > self.client = mqtt.Client(client_id=mqtt_options['clientid'], > userdata=self.userdata, > > clean_session=mqtt_options['clean_session']) > > rich > On Sunday 11 February 2024 at 15:21:58 UTC-5 matthew wall wrote: > >> On Sunday, February 11, 2024 at 1:37:20 PM UTC-5 bell...@gmail.com wrote: >> >> It currently will not work with paho mqtt 2.0.0 or higher. >> >> >> rich, i too am interested in what you learn, as i will probably have to >> update weewx-mqtt as well. m >> > -- 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/8b3fba7b-dfae-4105-8138-7381e5697017n%40googlegroups.com.