code: def set_pin(self, newPin: str, oldPin: str = None) -> dict:
          
          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
docs: 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