'Create a Nuimo object from MAC address or discovery.'

def _attach(self):

    from nuimo import NuimoController, NuimoDiscoveryManager
    if self._nuimo:
        self._nuimo.disconnect()
        self._nuimo = None
    if self._mac:
        self._nuimo = NuimoController(self._mac)
    else:
        nuimo_manager = NuimoDiscoveryManager(bluetooth_adapter=DEFAULT_ADAPTER, delegate=DiscoveryLogger())
        nuimo_manager.start_discovery()
        if (not nuimo_manager.nuimos):
            _LOGGER.debug('No    Nuimo    devices    detected')
            return
        self._nuimo = nuimo_manager.nuimos[0]
        self._mac = self._nuimo.addr
