'Set up the connection or be idle.'

def run(self):

    while self._hass_is_running:
        if ((not self._nuimo) or (not self._nuimo.is_connected())):
            self._attach()
            self._connect()
        else:
            time.sleep(1)
    if self._nuimo:
        self._nuimo.disconnect()
        self._nuimo = None
