code: def __getJoinerState(self):
          
          maxDuration = 150  # seconds
          t_end = time.time() + maxDuration
          while time.time() < t_end:
              joinerState = self.__stripValue(self.__sendCommand('sudo wpanctl getprop -v NCP:State')[0])
              if joinerState == 'offline:commissioned':
                  return True
              elif joinerState == 'associating:credentials-needed':
                  return False
              else:
                  time.sleep(5)
                  continue
          return False
docs: get joiner state