Skip to content

Commit

Permalink
Merge pull request #126 from Grizzelbee/Development
Browse files Browse the repository at this point in the history
V0.9.4 (2021-08-20)
  • Loading branch information
Grizzelbee authored Aug 20, 2021
2 parents 645d4e7 + f903273 commit 804767e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 217 deletions.
6 changes: 4 additions & 2 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Load our own files -->
<link href="style.css" rel="stylesheet" type="text/css"/>
<script src="words.js" type="text/javascript"></script>
<script src="./dyson-utils.js" type="text/javascript"></script>
<!--script src="./dyson-utils.js" type="text/javascript"></script-->

<script type="text/javascript">
if (typeof supportsFeature !== 'function' || !supportsFeature('ADAPTER_AUTO_DECRYPT_NATIVE')) {
Expand Down Expand Up @@ -123,8 +123,10 @@
break;
}
sendTo(null, 'getDyson2faMail', payload, (response) => {
JSON.stringify('Response: ' + response);
if (response.error) {
showError(response.error);
console.log('Error: ' + typeof response.error === 'object'? JSON.stringify(response.error): response.error);
showError('Error: ' + typeof response.error === 'object'? JSON.stringify(response.error): response.error);
$('.progress').addClass('hide');
return;
} else if (response.challengeId){
Expand Down
12 changes: 2 additions & 10 deletions dyson-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,8 @@ module.exports.getDyson2faMail = async function(adapter, email, passwd, country,
}
}
} catch(error){
adapter.log.error('getDyson2faMail: ' + error);
switch (error.response.status) {
case 401:
this.log.error(`Unable to login to dyson server (http error 401 - unauthorized). Please check your login data.`);
this.log.error(`OnMessage: Username: [${email}]`);
this.log.error(`OnMessage: Password: [${passwd}]`);
this.log.error(`OnMessage: country: [${country}]`);
this.log.error(`OnMessage: locale: [${locale}]`);
break;
}
adapter.log.error('CATCH-getDyson2faMail: ' + stringify(error));
return {error : `Received error: [${error}] from dyson API.\n These credentials have been used during this request: Username: [${email}], Password: [${passwd}], country: [${country}], locale: [${locale}].\nIf these credentials are okay please contact the developer via iobroker forum or github.`};
}
};

Expand Down
Loading

0 comments on commit 804767e

Please sign in to comment.