Skip to content

Commit

Permalink
chore: release v1.1.0
Browse files Browse the repository at this point in the history
* (foxriver76) allow to send web API commands even if Xbox is locally not connected
  • Loading branch information
foxriver76 committed Sep 4, 2023
1 parent b1c8314 commit 41eeea9
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
Expand All @@ -43,7 +43,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]

os: [ubuntu-latest, windows-latest, macos-latest]
steps:
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2022 Moritz Heusinger <moritz.heusinger@gmail.com>
Copyright (c) 2018-2023 Moritz Heusinger <moritz.heusinger@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ For every friend a channel will be created. Under this channel you will find sev
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->
### 1.1.0 (2023-09-04)
* (foxriver76) allow to send web API commands even if Xbox is locally not connected

### 1.0.2 (2022-12-14)
* (foxriver76) we have ensured, that instance object is existing again

Expand Down Expand Up @@ -581,7 +584,7 @@ self detected and prevents reconnection on shutdown
## License
The MIT License (MIT)
Copyright (c) 2018-2022 Moritz Heusinger <moritz.heusinger@gmail.com>
Copyright (c) 2018-2023 Moritz Heusinger <moritz.heusinger@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 8 additions & 5 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/main.js.map

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "xbox",
"version": "1.0.2",
"version": "1.1.0",
"news": {
"1.1.0": {
"en": "allow to send web API commands even if Xbox is locally not connected",
"de": "erlauben, Web-API-Befehle zu senden, auch wenn Xbox lokal nicht angeschlossen ist",
"ru": "позволяют отправлять команды web API, даже если Xbox локально не подключен",
"pt": "permitir enviar comandos de API da Web mesmo que o Xbox esteja conectado localmente",
"nl": "als Xbox niet met elkaar verbonden is",
"fr": "permettre d'envoyer des commandes API web même si Xbox n'est pas connecté localement",
"it": "consentire di inviare comandi web API anche se Xbox non è localmente collegato",
"es": "permite enviar comandos de API web incluso si Xbox no está conectado localmente",
"pl": "umożliwia wysłanie poleceń API w internecie, nawet jeśli Xbox nie jest lokalnie połączony ze sobą",
"uk": "не підключено до команди веб API, навіть якщо Xbox локально не підключено",
"zh-cn": "即使X箱在当地没有联系,也允许发送API指挥网。"
},
"1.0.2": {
"en": "we have ensured, that instance object is existing again",
"de": "wir haben sichergestellt, dass die instanz wieder existiert",
Expand Down Expand Up @@ -76,18 +89,6 @@
"es": "removido mensajería no utilizado",
"pl": "usunąć",
"zh-cn": "拆除未用的信息箱"
},
"1.0.0-beta.7": {
"en": "we have revived acknowledgment flag for power on state",
"de": "wir haben wieder anerkennungsfahne für macht auf staat",
"ru": "мы возродили флаг признания для власти на государственном",
"pt": "nós temos revivido bandeira de reconhecimento para poder no estado",
"nl": "we hebben een erkenningsflage voor macht op staat",
"fr": "nous avons relancé le drapeau de reconnaissance pour le pouvoir sur l'état",
"it": "abbiamo rianimato la bandiera di riconoscimento per il potere sullo stato",
"es": "hemos revivido bandera de reconocimiento para poder en estado",
"pl": "przywrócił się do flagi państwowej o władzę nad państwem",
"zh-cn": "我们恢复了国家权力的承认国旗"
}
},
"titleLang": {
Expand Down
65 changes: 32 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "iobroker.xbox",
"version": "1.0.2",
"version": "1.1.0",
"engines": {
"node": ">=12.0.0"
"node": ">=16.0.0"
},
"description": "ioBroker Xbox Adapter",
"author": {
Expand All @@ -28,7 +28,7 @@
"url": "https://github.com/foxriver76/ioBroker.xbox"
},
"dependencies": {
"@iobroker/adapter-core": "^2.6.2",
"@iobroker/adapter-core": "^3.0.3",
"xbox-smartglass-core-node": "^0.6.10",
"xbox-webapi": "^1.4.1"
},
Expand Down
16 changes: 10 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,6 @@ class Xbox extends utils.Adapter {
return;
}

if (!this.xboxConnected) {
this.log.warn(`Ignoring state change of "${id}", because not connected`);
return;
}

switch (id) {
case 'settings.power':
await this.powerOff();
Expand Down Expand Up @@ -959,6 +954,11 @@ class Xbox extends utils.Adapter {
* @param command command to send via media manager
*/
private async sendMediaCmd(command: string) {
if (!this.xboxConnected) {
this.log.warn(`Cannot send media command "${command}", because not connected`);
return;
}

try {
await this.SGClient.getManager('system_media').sendCommand(command);
} catch (e) {
Expand All @@ -972,6 +972,11 @@ class Xbox extends utils.Adapter {
* @param command command to send via input manager
*/
private async sendButton(command: string) {
if (!this.xboxConnected) {
this.log.warn(`Cannot send button command "${command}", because not connected`);
return;
}

try {
await this.SGClient.getManager('system_input').sendCommand(command);
} catch (e) {
Expand Down Expand Up @@ -1082,7 +1087,6 @@ class Xbox extends utils.Adapter {
this.APIClient._authentication._tokensFile = '.tokens.json';
try {
const data = await this.readFileAsync(this.name, 'tokens.json');
// @ts-expect-error
this.APIClient._authentication._tokens.oauth = JSON.parse(data.file as string);
this.log.info('Successfully loaded token');
} catch (e) {
Expand Down

0 comments on commit 41eeea9

Please sign in to comment.