Device: should be object (#/properties/settings/type)

Yes, you’re declaring it as an array, not an object.

It should look like this:

const settings = {
  username,
  password,
  pollInterval,
  regionCode,
};

Which is short for:

const settings = {
  username : username,
  password : password,
  pollInterval : pollInterval,
  regionCode : regionCode,
};