Skip to content

Commit

Permalink
release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Aug 14, 2024
1 parent 7ce1743 commit ab9cf62
Show file tree
Hide file tree
Showing 12 changed files with 1,636 additions and 1,657 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### NOTE

## After update to 2.x.x the plugin settings (xboxLiveId) need to be updated

## [3.0.0] - (14.08.2024)

## Changes

### After update to v9.0.0 RESTFull and MQTT config settings need to be updated

- hide passwords by typing and display in Config UI
- remove return duplicate promises from whole code
- bump dependencies
- cleanup

## [2.14.0] - (04.08.2024)

## Changes
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,20 @@ Homebridge plugin for Microsoft game Consoles. Tested with Xbox One X/S and Xbox
| `enableDebugMode` | If enabled, deep log will be present in homebridge console. |
| `disableLogInfo` | If enabled, disable log info, all values and state will not be displayed in Homebridge log console. |
| `disableLogDeviceInfo` | If enabled, add ability to disable log device info by every connections device to the network. |
| `enableRestFul` | If enabled, RESTful server will start automatically and respond to any path request. |
| `restFulPort` | Here set the listening `Port` for RESTful server. |
| `restFulDebug` | If enabled, deep log will be present in homebridge console for RESTFul server. |
| `enableMqtt` | If enabled, MQTT Broker will start automatically and publish all awailable PV installation data. |
| `mqttHost` | Here set the `IP Address` or `Hostname` for MQTT Broker. |
| `mqttPort` | Here set the `Port` for MQTT Broker, default 1883. |
| `mqttClientId` | Here optional set the `Client Id` of MQTT Broker. |
| `mqttPrefix` | Here set the`Prefix` for `Topic` or leave empty. |
| `mqttAuth` | If enabled, MQTT Broker will use authorization credentials. |
| `mqttUser` | Here set the `User` for MQTT Broker. |
| `mqttPasswd` | Here set the `Password` for MQTT Broker. |
| `mqttDebug` | If enabled, deep log will be present in homebridge console for MQTT. |
| `restFul` | This is RSTful server. |
| `enable` | If enabled, RESTful server will start automatically and respond to any path request. |
| `port` | Here set the listening `Port` for RESTful server. |
| `debug` | If enabled, deep log will be present in homebridge console for RESTFul server. |
| `mqtt` | This is MQTT Broker. |
| `enable` | If enabled, MQTT Broker will start automatically and publish all awailable PV data. |
| `host` | Here set the `IP Address` or `Hostname` for MQTT Broker. |
| `port` | Here set the `Port` for MQTT Broker, default 1883. |
| `clientId` | Here optional set the `Client Id` of MQTT Broker. |
| `prefix` | Here set the `Prefix` for `Topic` or leave empty. |
| `auth` | If enabled, MQTT Broker will use authorization credentials. |
| `user` | Here set the MQTT Broker user. |
| `passwd` | Here set the MQTT Broker password. |
| `debug` | If enabled, deep log will be present in homebridge console for MQTT. |
| `reference`, `oneStoreProductId` | If web Api enabled then all available in `./homebridge/xboxTv/inputs_xxxxxx` file. |

## Create App on Azure AD
Expand Down
273 changes: 151 additions & 122 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@
"type": "string",
"placeholder": "Web Api Token",
"description": "Here put the reponse Token (value after ?code=) from the authorization URL.",
"format": "password",
"condition": {
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
},
Expand All @@ -592,6 +593,7 @@
"type": "string",
"placeholder": "Client Secret",
"description": "Here set your Client Secret from Azure AD or leave empty if you do not have own account.",
"format": "password",
"condition": {
"functionBody": "return model.devices[arrayIndices].webApiControl === true;"
},
Expand Down Expand Up @@ -719,113 +721,131 @@
"description": "This enable RESTful server.",
"required": false
},
"restFulDebug": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode for RESTFul.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableRestFul === true;"
},
"required": false
},
"restFulPort": {
"title": "Port",
"type": "integer",
"placeholder": 3000,
"description": "Here set the listening Port for RESTful server.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableRestFul === true;"
},
"required": false
},
"enableMqtt": {
"title": "Enable",
"type": "boolean",
"default": false,
"description": "This enable MQTT client.",
"required": false
},
"mqttDebug": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode for MQTT.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true;"
},
"required": false
},
"mqttHost": {
"title": "IP/Hostname",
"type": "string",
"placeholder": "ip or hostname",
"format": "hostname",
"description": "Here set the IP/Hostname of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true;"
},
"required": false
},
"mqttPort": {
"title": "Port",
"type": "integer",
"placeholder": 1883,
"description": "Here set the port of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true;"
},
"required": false
},
"mqttPrefix": {
"title": "Prefix",
"type": "string",
"placeholder": "home/xbox",
"description": "Here set the prefix.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true;"
},
"required": false
},
"mqttClientId": {
"title": "Client ID",
"type": "string",
"placeholder": "client id",
"description": "Here optional set the Client ID of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true"
},
"required": false
},
"mqttAuth": {
"title": "Authorization",
"type": "boolean",
"default": false,
"description": "This enable authorization for MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true;"
},
"required": false
},
"mqttUser": {
"title": "User",
"type": "string",
"placeholder": "user",
"description": "Here set the user of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true && model.devices[arrayIndices].mqttAuth === true;"
},
"required": false
"restFul": {
"title": "RESTFul",
"type": "object",
"properties": {
"enable": {
"title": "Enable",
"type": "boolean",
"default": false,
"description": "This enable RESTful server."
},
"debug": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode for RESTFul.",
"condition": {
"functionBody": "return model.devices[arrayIndices].restFul.enable === true;"
},
"required": false
},
"port": {
"title": "Port",
"type": "integer",
"placeholder": 3000,
"description": "Here set the listening Port for RESTful server.",
"condition": {
"functionBody": "return model.devices[arrayIndices].restFul.enable === true;"
},
"required": false
}
}
},
"mqttPasswd": {
"title": "Password",
"type": "string",
"placeholder": "password",
"description": "Here set the password of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].enableMqtt === true && model.devices[arrayIndices].mqttAuth === true;"
},
"required": false
"mqtt": {
"title": "MQTT",
"type": "object",
"properties": {
"enable": {
"title": "Enable",
"type": "boolean",
"default": false,
"description": "This enable MQTT client."
},
"debug": {
"title": "Debug",
"type": "boolean",
"default": false,
"description": "This enable debug mode for MQTT.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
},
"required": false
},
"host": {
"title": "IP/Hostname",
"type": "string",
"placeholder": "ip or hostname",
"format": "hostname",
"description": "Here set the IP/Hostname of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
},
"required": false
},
"port": {
"title": "Port",
"type": "integer",
"placeholder": 1883,
"description": "Here set the port of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
},
"required": false
},
"clientId": {
"title": "Client ID",
"type": "string",
"placeholder": "client id",
"description": "Here optional set the Client ID of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true"
},
"required": false
},
"prefix": {
"title": "Prefix",
"type": "string",
"placeholder": "home/envoy",
"description": "Here set the prefix.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
},
"required": false
},
"auth": {
"title": "Authorization",
"type": "boolean",
"default": false,
"description": "This enable authorization for MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true;"
},
"required": false
},
"user": {
"title": "User",
"type": "string",
"placeholder": "user",
"description": "Here set the user of MQTT Broker.",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true && model.devices[arrayIndices].mqtt.auth === true;"
},
"required": false
},
"passwd": {
"title": "Password",
"type": "string",
"placeholder": "password",
"description": "Here set the password of MQTT Broker.",
"format": "password",
"condition": {
"functionBody": "return model.devices[arrayIndices].mqtt.enable === true && model.devices[arrayIndices].mqtt.auth === true;"
},
"required": false
}
}
}
}
}
Expand Down Expand Up @@ -954,9 +974,15 @@
"items": [
"devices[].webApiControl",
"devices[].webApiPowerOnOff",
"devices[].webApiToken",
{
"key": "devices[].webApiToken",
"type": "password"
},
"devices[].webApiClientId",
"devices[].webApiClientSecret"
{
"key": "devices[].webApiClientSecret",
"type": "password"
}
]
},
{
Expand All @@ -978,27 +1004,30 @@
"title": "{{ value.title }}",
"items": [
{
"key": "devices[]",
"key": "devices[].restFul",
"title": "RESTFul",
"items": [
"devices[].enableRestFul",
"devices[].restFulDebug",
"devices[].restFulPort"
"devices[].restFul.enable",
"devices[].restFul.debug",
"devices[].restFul.port"
]
},
{
"key": "devices[]",
"key": "devices[].mqtt",
"title": "MQTT",
"items": [
"devices[].enableMqtt",
"devices[].mqttDebug",
"devices[].mqttHost",
"devices[].mqttPort",
"devices[].mqttClientId",
"devices[].mqttPrefix",
"devices[].mqttAuth",
"devices[].mqttUser",
"devices[].mqttPasswd"
"devices[].mqtt.enable",
"devices[].mqtt.debug",
"devices[].mqtt.host",
"devices[].mqtt.port",
"devices[].mqtt.clientId",
"devices[].mqtt.prefix",
"devices[].mqtt.auth",
"devices[].mqtt.user",
{
"key": "devices[].mqtt.passwd",
"type": "password"
}
]
}
]
Expand Down
3 changes: 3 additions & 0 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class PluginUiServer extends HomebridgePluginUiServer {
tokensFile: tokensFile
}
const authentication = new Authentication(authConfig);
authentication.on('error', (error) => {
;
})

let data = {};
switch (mode) {
Expand Down
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class XboxPlatform {
...device,
xboxLiveId: 'removed',
webApiToken: 'removed',
webApiClientId: 'removed',
webApiClientSecret: 'removed',
mqttUser: 'removed',
mqttPasswd: 'removed'
mqtt: {
...device.mqtt,
passwd: 'removed'
}
};
const debug1 = debugMode ? log(`Device: ${deviceHost} ${deviceName}, Config: ${JSON.stringify(config, null, 2)}`) : false;

Expand Down
Loading

0 comments on commit ab9cf62

Please sign in to comment.