Skip to content

Commit

Permalink
beta 1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoduj committed Jan 29, 2022
1 parent ff150a6 commit 12cd58d
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 102 deletions.
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
language: node_js
node_js:
- '10'
- '12'
- '13'
- '14'
- '15'
- '16'

jobs:
include:
- stage: npm release
if: tag IS present
node_js: '12'
node_js: '16'
script: echo "Deploying to npm ..."
deploy:
provider: npm
email: '$NPM_EMAIL'
api_key: '$NPM_TOKEN'
tag: beta
on:
tags: true
edge: true
- stage: GitHub Release
if: tag IS present
node_js: '12'
node_js: '16'
script: echo "Deploying to GitHub releases ..."
deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
cleanup: true
prerelease: true
tag: beta
name: $TRAVIS_TAG
on:
tags: true
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## 1.6.0(beta)

- [NEW] Option for sorting activities either alphabetically or by activity order in harmony conf or by activitiesToPublishAsInputForTVMode option order (thx to @alapitz PR - Sort the activities alphabetically #384)
- [FIX] trying to fix slow response message. Socket closed warning can still occur, but should reconnect and not block the bridge

## 1.5.4

- [NEW] Option for sorting activities either alphabetically or by activity order in harmony conf (thx to @alapitz PR - Sort the activities alphabetically #384)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Fields:
- `hubName` is the name of your hub in harmony app (optional, but mandatory if you have mutliple hubs). In case both hubName and hubIP are not set, it will discover your hub automatically, providing there is only one
- `hubIP` is the static IP address of the hub (optional). A static IP address is required.
- `TVAccessory` publish hub with its activities as a TV Accessory (defaults to true).
- `SortInput` sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property(defaults to 0).
- `sortInput` sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property of hub, 3:activitiesToPublishAsInputForTVMode order (defaults to 0).
- `switchAccessories` publish all activities as a Switch Accessory (defaults to false).
- `activitiesToPublishAsAccessoriesSwitch` array of Activities you want to expose as switches (all by default if switchAccessories is set to true, otherwise specify the list you want)
- `showTurnOffActivity` configures whether to publish a "switch" accessory to turn off every activity (defaults to false).
Expand Down
16 changes: 8 additions & 8 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
"title": "TV accessory in homekit (Defaults to true if not set)",
"type": "boolean"
},
"SortInput": {
"title": "sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property (defaults to 0).",
"sortInput": {
"title": "sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property of hub, 3:activitiesToPublishAsInputForTVMode order (defaults to 0).",
"type": "integer",
"default": 0,
"minimum": 0,
"maximum": 2
"maximum": 3
},
"configureAccesscontrol": {
"title": "Enable Access Control Service (false by default)",
Expand Down Expand Up @@ -338,12 +338,12 @@
"title": "TV accessory in homekit (Defaults to true if not set)",
"type": "boolean"
},
"SortInput": {
"title": "sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property (defaults to 0).",
"sortInput": {
"title": "sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property of hub, 3:activitiesToPublishAsInputForTVMode order (defaults to 0).",
"type": "integer",
"default": 0,
"minimum": 0,
"maximum": 2
"maximum": 3
},
"configureAccesscontrol": {
"title": "Enable Access Control Service (false by default)",
Expand Down Expand Up @@ -617,7 +617,7 @@
"description": "Publish hub with its activities as a TV Accessory"
},
{
"key": "SortInput",
"key": "sortInput",
"description": "sort input list in TV accessory"
},
{
Expand Down Expand Up @@ -991,7 +991,7 @@
"description": "Publish hub with its activities as a TV Accessory"
},
{
"key": "otherPlatforms[].SortInput",
"key": "otherPlatforms[].sortInput",
"description": "sort input list in TV accessory"
},
{
Expand Down
60 changes: 21 additions & 39 deletions harmonyBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ HarmonyBase.prototype = {

//REFRESH
refreshCurrentActivity: function (harmonyPlatform, callback) {
//Infinite llop handling on errors / network loss ?
//Infinite loop handling on errors / network loss ?

if (this.numberOfErrors >= HarmonyConst.MAX_SOCKET_ERROR) {
harmonyPlatform.log(
Expand Down Expand Up @@ -1350,39 +1350,9 @@ HarmonyBase.prototype = {
},

//ACCESSORIES, SERVICES AND CHARACERISTICS
handleCharacteristicUpdate: function (harmonyPlatform, characteristic, value, callback) {
if (harmonyPlatform._currentActivity == HarmonyConst.CURRENT_ACTIVITY_NOT_SET_VALUE) {
if (callback) {
callback(1);
}
//this.updateCharacteristicToErr(characteristic, callback);
} else {
this.updateCharacteristic(characteristic, value, callback);
}
},

/*
updateCharacteristicToErr: function (characteristic, callback) {
try {
if (callback) {
callback(1);
} else {
characteristic.updateValue(undefined);
}
} catch (error) {
characteristic.updateValue(undefined);
}
},
*/

updateCharacteristic: function (characteristic, characteristicValue, callback) {
try {
if (callback) {
callback(undefined, characteristicValue);
} else {
characteristic.updateValue(characteristicValue);
}
} catch (error) {
handleCharacteristicUpdate: function (harmonyPlatform, characteristic, characteristicValue) {
if (harmonyPlatform._currentActivity !== HarmonyConst.CURRENT_ACTIVITY_NOT_SET_VALUE) {
characteristic.updateValue(characteristicValue);
}
},
Expand Down Expand Up @@ -1553,6 +1523,11 @@ HarmonyBase.prototype = {
},

getSwitchOnCharacteristic(harmonyPlatform, service, callback) {
//return immediately
if (callback) {
callback(undefined, service.getCharacteristic(Characteristic.On).value);
}

if (service.type === HarmonyConst.HOME_TYPE) {
this.getHomeControlsAccessories(harmonyPlatform).then((responseHome) => {
var newValue = false;
Expand All @@ -1562,8 +1537,7 @@ HarmonyBase.prototype = {
this.handleCharacteristicUpdate(
harmonyPlatform,
service.getCharacteristic(Characteristic.On),
newValue,
callback
newValue
);
});
} else {
Expand Down Expand Up @@ -1636,6 +1610,11 @@ HarmonyBase.prototype = {
},

getSliderOnCharacteristic: function (harmonyPlatform, service, callback) {
//return immediately
if (callback) {
callback(undefined, service.getCharacteristic(Characteristic.On).value);
}

let isOn = false;
//always on if current activity set and volumes is mapped , off otherwise
if (
Expand All @@ -1649,8 +1628,7 @@ HarmonyBase.prototype = {
this.handleCharacteristicUpdate(
harmonyPlatform,
service.getCharacteristic(Characteristic.On),
isOn,
callback
isOn
);
},

Expand Down Expand Up @@ -1697,6 +1675,11 @@ HarmonyBase.prototype = {
},

getSliderVolumeCharacteristic: function (harmonyPlatform, service, callback) {
//return immediately
if (callback) {
callback(undefined, service.getCharacteristic(Characteristic.Brightness).value);
}

var newVolume = 0;
//always on if current activity set and volumes is mapped , off otherwise
if (
Expand All @@ -1710,8 +1693,7 @@ HarmonyBase.prototype = {
this.handleCharacteristicUpdate(
harmonyPlatform,
service.getCharacteristic(Characteristic.Brightness),
newVolume,
callback
newVolume
);
},

Expand Down
2 changes: 1 addition & 1 deletion harmonyConst.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAX_ATTEMPS_STATUS_UPDATE = 15;
DELAY_BETWEEN_ATTEMPS_STATUS_UPDATE = 2000;
DELAY_TO_UPDATE_STATUS = 500;
DELAY_LAUNCH_REFRESH = 2500;
DELAY_BEFORE_RECONNECT = 10000;
DELAY_BEFORE_RECONNECT = 5000;
DELAY_FOR_STATELESS_SWITCH_UPDATE = 350;
DELAY_FOR_SLIDER_UPDATE = 500;
DELAY_FOR_MACRO = 350;
Expand Down
Loading

0 comments on commit 12cd58d

Please sign in to comment.