def set_pin(self, newPin: str, oldPin: str = None) -> dict:
        """ sets a new pin for the home

        Args:
            newPin(str): the new pin
            oldPin(str): optional, if there is currently a pin active it must be given here.
                        Otherwise it will not be possible to set the new pin

        Returns:
            the result of the call
        """
        if newPin == None:
            newPin = ""
        data = {"pin": newPin}
        if oldPin:
            self._connection.headers["PIN"] = str(oldPin)
        result = self._restCall("home/setPin", body=json.dumps(data))
        if oldPin:
            del self._connection.headers["PIN"]
        return result
sets a new pin for the home

        Args:
            newPin(str): the new pin
            oldPin(str): optional, if there is currently a pin active it must be given here.
                        Otherwise it will not be possible to set the new pin

        Returns:
            the result of the call