Skip to content

Commit

Permalink
v6.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Jun 26, 2021
1 parent 3dd2ceb commit 3b03f79
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 64 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# 6.0.6 - 2021-06-27

## Other Changes
- Fixed an issue where broadband received wrong state/value
- Updated dependencies

# 6.0.5 - 2021-06-23

## Other Changes
Expand Down
20 changes: 10 additions & 10 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,6 +1,6 @@
{
"name": "homebridge-fritz-platform",
"version": "6.0.5",
"version": "6.0.6",
"description": "Homebridge Plugin to control FritzBox router, smarthome devices and more.",
"main": "index.js",
"funding": [
Expand Down Expand Up @@ -48,7 +48,7 @@
"homebridge": "^1.3.0"
},
"dependencies": {
"@seydx/fritzbox": "^2.2.6",
"@seydx/fritzbox": "^2.2.7",
"fakegato-history": "0.6.1",
"form-data": "^4.0.0",
"fs-extra": "10.0.0",
Expand All @@ -63,6 +63,6 @@
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-prettier": "^3.4.0",
"prettier": "^2.3.1"
"prettier": "^2.3.2"
}
}
2 changes: 2 additions & 0 deletions src/accessories/callmonitor/callmonitor.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
CallmonitorAccessory: require('./callmonitor.accessory'),
CallmonitorHandler: require('./callmonitor.handler'),
Expand Down
8 changes: 0 additions & 8 deletions src/accessories/childlock/childlock.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class Handler {
.getService(this.api.hap.Service.Switch)
.getCharacteristic(this.api.hap.Characteristic.On).value;

if (accessory.context.busy) {
return state;
}

try {
const states = [];
const ipList = accessory.context.config.ips;
Expand Down Expand Up @@ -92,8 +88,6 @@ class Handler {

subtype = subtype || accessory.context.config.subtype;

accessory.context.busy = true;

logger.info(`${state ? 'ON' : 'OFF'}`, `${accessory.displayName} (${subtype})`);

try {
Expand All @@ -113,8 +107,6 @@ class Handler {
logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`);
logger.error(err, `${accessory.displayName} (${subtype})`);
}

accessory.context.busy = false;
}

async poll() {
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/childlock/childlock.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
ChildLockAccessory: require('./childlock.accessory'),
ChildLockHandler: require('./childlock.handler'),
Expand Down
8 changes: 0 additions & 8 deletions src/accessories/extras/extras.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ class Handler {
let characteristic = ownCharacteristic ? ownCharacteristic : this.api.hap.Characteristic.On;
let state = accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).value;

if (accessory.context.busy) {
return state;
}

switch (subtype) {
case 'alarm':
break;
Expand Down Expand Up @@ -225,8 +221,6 @@ class Handler {
let fritzbox = accessory.context.config.fritzbox || this.fritzbox;
let characteristic = ownCharacteristic ? ownCharacteristic : this.api.hap.Characteristic.On;

accessory.context.busy = true;

switch (subtype) {
case 'alarm': {
try {
Expand Down Expand Up @@ -745,8 +739,6 @@ class Handler {
);
break;
}

accessory.context.busy = false;
}

async poll() {
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/extras/extras.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
ExtrasAccessory: require('./extras.accessory'),
ExtrasHandler: require('./extras.handler'),
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/network/network.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
NetworkAccessory: require('./network.accessory'),
NetworkHandler: require('./network.handler'),
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/presence/presence.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
PresenceMotionAccessory: require('./motion/motion.accessory'),
PresenceOccupancyAccessory: require('./occupancy/occupancy.accessory'),
Expand Down
2 changes: 1 addition & 1 deletion src/accessories/router/router.accessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class Accessory {

service
.getCharacteristic(this.api.hap.Characteristic.Download)
.onGet(() => this.handler.get(this.accessory, 'broadband'));
.onGet(() => this.handler.get(this.accessory, 'broadband', this.api.hap.Characteristic.Download));
} else {
if (service.testCharacteristic(this.api.hap.Characteristic.Download)) {
logger.info(
Expand Down
10 changes: 1 addition & 9 deletions src/accessories/router/router.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ class Handler {
let characteristic = ownCharacteristic ? ownCharacteristic : this.api.hap.Characteristic.On;
let state = accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).value;

if (accessory.context.busy) {
return state;
}

switch (subtype) {
case 'dsl': {
try {
Expand Down Expand Up @@ -366,7 +362,7 @@ class Handler {
}

//old fw
if (body && body.data && body.data.led_display) {
if (body && body.data) {
state = parseInt(body.data.led_display) === 0;
}
} catch (err) {
Expand Down Expand Up @@ -468,8 +464,6 @@ class Handler {
let fritzbox = accessory.context.config.fritzbox || this.fritzbox;
let characteristic = ownCharacteristic ? ownCharacteristic : this.api.hap.Characteristic.On;

accessory.context.busy = true;

switch (subtype) {
case 'dsl': {
logger.info(`${state ? 'ON' : 'OFF'}`, `${accessory.displayName} (${subtype})`);
Expand Down Expand Up @@ -987,8 +981,6 @@ class Handler {
);
break;
}

accessory.context.busy = false;
}

async poll() {
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/router/router.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
RouterAccessory: require('./router.accessory'),
RouterHandler: require('./router.handler'),
Expand Down
21 changes: 0 additions & 21 deletions src/accessories/smarthome/smarthome.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ class Handler {

let state = accessory.getService(service).getCharacteristic(this.api.hap.Characteristic.On).value;

if (accessory.context.busy) {
return state;
}

let bulbState = accessory
.getService(this.api.hap.Service.Lightbulb)
.getCharacteristic(this.api.hap.Characteristic.On).value;
Expand Down Expand Up @@ -440,10 +436,6 @@ class Handler {
.getService(this.api.hap.Service.Lightbulb)
.getCharacteristic(this.api.hap.Characteristic.On).value;

if (accessory.context.busy) {
return state;
}

let brightness, temp, hue, sat;

if (accessory.context.config.brightness) {
Expand Down Expand Up @@ -592,10 +584,6 @@ class Handler {

let state = service.getCharacteristic(this.api.hap.Characteristic.On).value;

if (accessory.context.busy) {
return state;
}

try {
let device = !accessory.context.config.group
? this.smarthomeList.devices.find((device) => device.ain.includes(accessory.context.config.ain))
Expand Down Expand Up @@ -939,11 +927,6 @@ class Handler {
.getService(this.api.hap.Service.HeaterCooler)
.getCharacteristic(this.api.hap.Characteristic.HeatingThresholdTemperature).value;

if (accessory.context.busy) {
//assuming we are calling GET event for Characteristic.Active
return active;
}

try {
let device = !accessory.context.config.group
? this.smarthomeList.devices.find((device) => device.ain.includes(accessory.context.config.ain))
Expand Down Expand Up @@ -1140,8 +1123,6 @@ class Handler {

subtype = subtype || accessory.context.config.subtype;

accessory.context.busy = true;

switch (subtype) {
case 'smarthome-switch-lightbulb':
{
Expand Down Expand Up @@ -1663,8 +1644,6 @@ class Handler {
);
break;
}

accessory.context.busy = false;
}

async poll() {
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/smarthome/smarthome.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
SHBlindAccessory: require('./blind/blind.accessory'),
SHButtonAccessory: require('./button/button.accessory'),
Expand Down
4 changes: 0 additions & 4 deletions src/accessories/wol/wol.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class Handler {
// eslint-disable-next-line no-unused-vars
subtype = subtype || accessory.context.config.subtype;

accessory.context.busy = true;

try {
logger.info('ON', `${accessory.displayName} (${subtype})`);

Expand All @@ -68,8 +66,6 @@ class Handler {
1000
);
}

accessory.context.busy = false;
}

async poll() {}
Expand Down
2 changes: 2 additions & 0 deletions src/accessories/wol/wol.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
WolAccessory: require('./wol.accessory'),
WolHandler: require('./wol.handler'),
Expand Down

0 comments on commit 3b03f79

Please sign in to comment.