Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix(carelink): Fix login error 400 when logging in as carepartner #42

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion carelink.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ var Client = exports.Client = function (options) {
logger.log('GET data (as carepartner) ' + dataRetrievalUrl);
var body = {
username: options.username,
role: "carepartner"
role: "carepartner",
patientId: options.patientId
};
return await axiosInstance.post(dataRetrievalUrl,body,{

Expand Down
4 changes: 3 additions & 1 deletion run.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var config = {
maxRetryDuration: parseInt(readEnv('CARELINK_MAX_RETRY_DURATION', carelink.defaultMaxRetryDuration), 10),
verbose: !readEnv('CARELINK_QUIET', true),
deviceInterval: 5.1 * 60 * 1000,
patientId: readEnv('CARELINK_PATIENT'),
};

if (!config.username) {
Expand All @@ -43,7 +44,8 @@ if (!config.username) {
var client = carelink.Client({
username: config.username,
password: config.password,
maxRetryDuration: config.maxRetryDuration
maxRetryDuration: config.maxRetryDuration,
patientId: config.patientId
});
var entriesUrl = (config.nsBaseUrl ? config.nsBaseUrl : 'https://' + config.nsHost) + '/api/v1/entries.json';
var devicestatusUrl = (config.nsBaseUrl ? config.nsBaseUrl : 'https://' + config.nsHost) + '/api/v1/devicestatus.json';
Expand Down