List<Object?> toJson() { return [ type, 'id', id, 'command', command, if (commandParams != null) ...['commandParams', commandParams], ]; }