publish device and node properties, run forever

def start(self):
        """publish device and node properties, run forever"""
        self.publish_properties()
        self.subscribe_topics()
        gc.collect()

        self.set_state("ready")

        while True:
            try:
                if not utils.wlan.isconnected():
                    utils.wifi_connect()

                # publish device data
                self.publish_data()

                # check for new mqtt messages
                self.mqtt.check_msg()

                idle()
                sleep(1)
            except KeyboardInterrupt:
                self.set_state("disconnected")
                self.mqtt.disconnect()