publish device and node properties

def publish_properties(self):
        """publish device and node properties"""
        publish = self.publish

        # device properties
        publish(b"$homie", b"3.0.1")
        publish(b"$name", self.settings.DEVICE_NAME)
        publish(b"$state", b"init")
        publish(b"$fw/name", b"Microhomie")
        publish(b"$fw/version", __version__)
        publish(b"$implementation", bytes(sys.platform, "utf-8"))
        publish(b"$localip", utils.get_local_ip())
        publish(b"$mac", utils.get_local_mac())
        publish(b"$stats", b"interval,uptime,freeheap")
        publish(b"$stats/interval", self.stats_interval)
        publish(b"$nodes", b",".join(self.node_ids))

        # node properties
        for node in self.nodes:
            try:
                for propertie in node.get_properties():
                    if propertie:
                        publish(*propertie)
            except NotImplementedError:
                raise
            except Exception as error:
                self.node_error(node, error)