def _login_user(self):
        """
        Ask user login
        """

        # send message to arduino to bling the LED
        self._send_message_to_arduino("3")
        self._logger.info("Please enter your email and password to login")
        user = User()
        sys.stdout.write("email: ")
        user._email = sys.stdin.readline()
        sys.stdout.write("password: "******"Login failed. Please check your internet and/or serial connection and retry")
            self._login_user()
        elif user._uuid == "none":
            self._logger.info("Login failed")
            self._login_user()
        elif re.compile("[\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12}").match(user._uuid):
            self._save_user_settings(user)
            self._logger.info("Login successful")

        # send message to arduino to put off LED
        self._send_message_to_arduino("4")
    def add_user(self):
        """
        Add user in data file
        """

        self._logger.info("Please enter user information")
        user = User()
        # ask user information
        sys.stdout.write("first name: ")
        user._first_name = sys.stdin.readline()
        sys.stdout.write("last name: ")
        user._last_name = sys.stdin.readline()
        sys.stdout.write("email: ")
        user._email = sys.stdin.readline()
        sys.stdout.write("password: "******"\n", ""),
            'lastName': user._last_name.replace("\n", ""),
            'email': user._email.replace("\n", ""),
            'password': user._password,
            'uuid': user._uuid
        }

        # add user to the dict
        users.append(new_user)

        # save user settings in json file
        with open(DATA_FILE_LOCATION + DATA_FILE_NAME, "w") as file:
            json.dump(users, file, indent = 4, encoding = 'utf-8')

        # init user work data file
        with open(DATA_FILE_LOCATION + user._uuid + ".json", "w") as file:
            user_hours = {
                "uuid": user._uuid,
                "currentState": "",
                "workingHours": []
            }
            json.dump(user_hours, file, indent = 4, encoding = 'utf-8')

        self._logger.info("User successfully added ")
        self._logger.debug("New user added (id: %s - email: %s)", user._id, user._email)