This quickly builds a time-stamped message. If `ts` is None, the
    current time is used.

def device_message(device,
                   code,
                   ts=None,
                   origin=None,
                   type=None,
                   severity=None,
                   title=None,
                   description=None,
                   hint=None,
                   **metaData):
    # pylint: disable=redefined-builtin, too-many-arguments
    """This quickly builds a time-stamped message. If `ts` is None, the
    current time is used.
    """
    if ts is None:
        ts = local_now()
    payload = MessagePayload(device=device)
    payload.messages.append(
        Message(
            code=code,
            ts=ts,
            origin=origin,
            type=type,
            severity=severity,
            title=title,
            description=description,
            hint=hint,
            **metaData))
    return dumps(payload)