Skip to content

Commit

Permalink
chore: release v1.2.3
Browse files Browse the repository at this point in the history
Update packages
Fix compatibility issues with new ring api
  • Loading branch information
theimo1221 committed Jul 30, 2021
1 parent 0a031f8 commit 12ababf
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 320 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ on({id: "ring.0.doorbell_4711.kind"/*Kind*/}, (obj) => {
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->
### 1.2.3 (2021-07-30)
* (theimo1221) Update packages
* (theimo1221) Fix compatibility issues with new ring api

### 1.2.2 (2021-05-05)
* (theimo1221) Update packages due to security patches

Expand Down
18 changes: 13 additions & 5 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
{
"common": {
"name": "ring",
"version": "1.2.2",
"version": "1.2.3",
"title": "Ring",
"news": {
"1.2.3": {
"en": "Update packages\nFix compatibility issues with new ring api",
"de": "Pakete aktualisieren\nKompatibilitätsprobleme mit der neuen Ring-API beheben",
"ru": "Пакеты обновлений\nУстранение проблем совместимости с новым кольцевым API",
"pt": "Pacotes de atualização\nCorrija problemas de compatibilidade com a nova API de anel",
"nl": "Pakketten bijwerken\nCompatibiliteitsproblemen oplossen met nieuwe ring api",
"fr": "Mettre à jour les packages\nRésoudre les problèmes de compatibilité avec la nouvelle API Ring",
"it": "Aggiorna pacchetti\nRisolvi i problemi di compatibilità con la nuova API dell'anello",
"es": "Actualizar paquetes\nSolucionar problemas de compatibilidad con la nueva API de anillo",
"pl": "Zaktualizuj pakiety\nNapraw problemy ze zgodnością z nowym ring api",
"zh-cn": "更新包\n修复与新环 api 的兼容性问题"
},
"1.2.2": {
"en": "Update packages due to security patches",
"de": "Aktualisieren Sie Pakete aufgrund von Sicherheitspatches",
Expand Down Expand Up @@ -175,10 +187,6 @@
"1.0.1": {
"en": "Support of compact mode",
"de": "Compact mode Unterstützung"
},
"1.0.0": {
"en": "Add Ring Camera as new device",
"de": "Ring Camera Unterstützung"
}
},
"titleLang": {
Expand Down
34 changes: 18 additions & 16 deletions lib/ringapiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,23 @@ class RingApiClient {
// okday
getRing() {
try {
if (!this.ring) {
if (this.adapter.config.refreshtoken) {
this.ring = new RingApi({
refreshToken: this.adapter.config.refreshtoken,
cameraStatusPollingSeconds: 20,
cameraDingsPollingSeconds: 1
});
} else {
this.ring = new RingApi({
email: this.adapter.config.email,
password: this.adapter.config.password,
cameraStatusPollingSeconds: 20,
cameraDingsPollingSeconds: 1
});
}
if (this.ring) {
// this.adapter.log.debug('Ring: ' + JSON.stringify(this.ring));
return this.ring;
}
if (this.adapter.config.refreshtoken) {
this.ring = new RingApi({
refreshToken: this.adapter.config.refreshtoken,
cameraStatusPollingSeconds: 20,
cameraDingsPollingSeconds: 1
});
} else {
this.ring = new RingApi({
email: this.adapter.config.email,
password: this.adapter.config.password,
cameraStatusPollingSeconds: 20,
cameraDingsPollingSeconds: 1
});
}
// this.adapter.log.debug('Ring: ' + JSON.stringify(this.ring));
return this.ring;
Expand Down Expand Up @@ -487,4 +489,4 @@ class RingApiClient {

module.exports = {
RingApiClient: RingApiClient
};
};
Loading

1 comment on commit 12ababf

@theimo1221
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adresses #132

Please sign in to comment.