Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownskl committed Mar 19, 2021
2 parents 5b1d8ad + c901315 commit ecd4ea3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v1.0.2 - 2021-03-19
- Fixed a bug that can crash homebridge when no devices are defined in the config

## v1.0.1 - 2021-03-12
- Complete rewrite of the Smartglass plugin with xbox api functionalities. Allows you to launch apps and have realtime status of your console.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Homebridge-Smartglass

[![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)
[![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)
[![npm](https://img.shields.io/npm/v/homebridge-smartglass.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-smartglass)
[![npm](https://img.shields.io/npm/dt/homebridge-smartglass.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-smartglass)

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Xbox Smartglass",
"name": "homebridge-smartglass",
"version": "1.0.1",
"version": "1.0.2",
"description": "Smartglass plugin for homebridge. Allows you to control your Xbox using Homekit",
"main": "dist/index.js",
"license": "Apache-2.0",
Expand Down
20 changes: 3 additions & 17 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SmartglassPlatform implements DynamicPlatformPlugin {
public readonly config: PlatformConfig,
public readonly api: API,
) {
this.log.debug('Finished initializing platform:', this.config.name);
this.log.debug('Finished initializing platform:', this.config.platform);

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

// EXAMPLE ONLY
// A real plugin you would discover accessories from the local network, cloud services
// or a user-defined array in the platform config.
// const exampleDevices = [
// {
// exampleUniqueId: 'ABCD',
// exampleDisplayName: 'Bedroom',
// },
// {
// exampleUniqueId: 'EFGH',
// exampleDisplayName: 'Kitchen',
// },
// ];

const exampleDevices = this.config.devices as DeviceConfig[];
const configDevices = this.config.devices as DeviceConfig[] || [];


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

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

0 comments on commit ecd4ea3

Please sign in to comment.