Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit ecd4ea3

Browse files
committed
Merge branch 'release/1.0.2'
2 parents 5b1d8ad + c901315 commit ecd4ea3

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v1.0.2 - 2021-03-19
4+
- Fixed a bug that can crash homebridge when no devices are defined in the config
5+
36
## v1.0.1 - 2021-03-12
47
- Complete rewrite of the Smartglass plugin with xbox api functionalities. Allows you to launch apps and have realtime status of your console.
58

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Homebridge-Smartglass
44

5-
[![Build and Lint](https://github.com/unknownskl/homebridge-smartglass/actions/workflows/build.yml/badge.svg?branch=release%2F1.0.1)](https://github.com/unknownskl/homebridge-smartglass/actions/workflows/build.yml)
5+
[![Build and Lint](https://github.com/unknownskl/homebridge-smartglass/actions/workflows/build.yml/badge.svg?branch=release%2F1.0.2)](https://github.com/unknownskl/homebridge-smartglass/actions/workflows/build.yml)
66
[![npm](https://img.shields.io/npm/v/homebridge-smartglass.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-smartglass)
77
[![npm](https://img.shields.io/npm/dt/homebridge-smartglass.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-smartglass)
88

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"displayName": "Xbox Smartglass",
33
"name": "homebridge-smartglass",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"description": "Smartglass plugin for homebridge. Allows you to control your Xbox using Homekit",
66
"main": "dist/index.js",
77
"license": "Apache-2.0",

src/platform.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class SmartglassPlatform implements DynamicPlatformPlugin {
3131
public readonly config: PlatformConfig,
3232
public readonly api: API,
3333
) {
34-
this.log.debug('Finished initializing platform:', this.config.name);
34+
this.log.debug('Finished initializing platform:', this.config.platform);
3535

3636
// When this event is fired it means Homebridge has restored all cached accessories from disk.
3737
// Dynamic Platform plugins should only register new accessories after this event was fired,
@@ -62,25 +62,11 @@ export class SmartglassPlatform implements DynamicPlatformPlugin {
6262
*/
6363
discoverDevices() {
6464

65-
// EXAMPLE ONLY
66-
// A real plugin you would discover accessories from the local network, cloud services
67-
// or a user-defined array in the platform config.
68-
// const exampleDevices = [
69-
// {
70-
// exampleUniqueId: 'ABCD',
71-
// exampleDisplayName: 'Bedroom',
72-
// },
73-
// {
74-
// exampleUniqueId: 'EFGH',
75-
// exampleDisplayName: 'Kitchen',
76-
// },
77-
// ];
78-
79-
const exampleDevices = this.config.devices as DeviceConfig[];
65+
const configDevices = this.config.devices as DeviceConfig[] || [];
8066

8167

8268
// loop over the discovered devices and register each one if it has not already been registered
83-
for (const device of exampleDevices) {
69+
for (const device of configDevices) {
8470

8571
// generate a unique id for the accessory this should be generated from
8672
// something globally unique, but constant, for example, the device serial

0 commit comments

Comments
 (0)