Skip to content

Commit

Permalink
test ownName ownNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
forelleblau committed Oct 11, 2023
1 parent 9932314 commit a0943c6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,12 @@ class Gsmsms extends utils.Adapter {
const result = await gsmModem.getOwnNumber();
this.log.debug(`Own number: ${JSON.stringify(result)}`);
this.log.info('Your number: ' + result.data.number + ', your name: ' + result.data.name);
this.setState('info.ownNumber', result.data.number, true);
this.setState('info.ownName', result.data.name, true);
this.setState('admin.ownNumber', result.data.number, true);
this.setState('admin.ownName', result.data.name, true);
if (result.data.number && result.data.name) {
this.setState('info.ownNumber', result.data.number, true);
this.setState('info.ownName', result.data.name, true);
this.setState('admin.ownNumber', result.data.number, true);
this.setState('admin.ownName', result.data.name, true);
}
} catch (err) {
this.log.warn(`Error retrieving own Number - ${err}`);
this.setState('info.error', JSON.stringify(err), true);
Expand Down

0 comments on commit a0943c6

Please sign in to comment.