diff --git a/src/accessories/childlock/childlock.handler.js b/src/accessories/childlock/childlock.handler.js index 4a1fe4b..c909a0a 100644 --- a/src/accessories/childlock/childlock.handler.js +++ b/src/accessories/childlock/childlock.handler.js @@ -69,7 +69,7 @@ class Handler { state = !states.includes(1); } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -111,7 +111,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.context.busy = false; diff --git a/src/accessories/extras/extras.handler.js b/src/accessories/extras/extras.handler.js index f9014ff..857633d 100644 --- a/src/accessories/extras/extras.handler.js +++ b/src/accessories/extras/extras.handler.js @@ -122,7 +122,7 @@ class Handler { state = actives.includes(1) ? true : false; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -152,7 +152,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -193,7 +193,7 @@ class Handler { state = onState === activeValue; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -268,7 +268,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -505,7 +505,7 @@ class Handler { logger.info('Done!', `${accessory.displayName} (${subtype})`); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } finally { setTimeout( () => @@ -600,7 +600,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -625,7 +625,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -676,7 +676,7 @@ class Handler { await requestLUA(formData, fritzbox.url.hostname, '/data.lua'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -728,7 +728,7 @@ class Handler { await requestLUA(formData, fritzbox.url.hostname, '/data.lua'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => diff --git a/src/accessories/network/network.handler.js b/src/accessories/network/network.handler.js index 4e4d2eb..d4e70eb 100644 --- a/src/accessories/network/network.handler.js +++ b/src/accessories/network/network.handler.js @@ -112,7 +112,7 @@ class Handler { } } catch (err) { logger.error('An error occured during polling network this.device!', this.device.name); - logger.error(err); + logger.error(err, this.device.name); } finally { setTimeout(() => this.poll(), this.device.polling * 1000); } diff --git a/src/accessories/router/router.handler.js b/src/accessories/router/router.handler.js index 26b6a18..2f81ea2 100644 --- a/src/accessories/router/router.handler.js +++ b/src/accessories/router/router.handler.js @@ -119,13 +119,13 @@ class Handler { logger.info('OFF script executed successfully!', `${accessory.displayName} (${subtype})`); } catch (err) { logger.error('An error occured during executing OFF script!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -151,13 +151,13 @@ class Handler { logger.info('OFF script executed successfully!', `${accessory.displayName} (${subtype})`); } catch (err) { logger.error('An error occured during executing OFF script!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -172,7 +172,7 @@ class Handler { state = response.NewEnable === '1'; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -192,7 +192,7 @@ class Handler { state = response.NewEnable === '1'; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -227,7 +227,7 @@ class Handler { state = responses.some((response) => response && response.NewEnable === '1'); } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -247,7 +247,7 @@ class Handler { state = response.NewEnable === '1'; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -265,7 +265,7 @@ class Handler { state = response['NewX_AVM-DE_WPSStatus'] === 'on'; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -294,7 +294,7 @@ class Handler { state = body.checked || body.checked === ''; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -311,7 +311,7 @@ class Handler { state = response.NewEnable === '1'; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -338,7 +338,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -371,7 +371,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -400,7 +400,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory.getService(this.api.hap.Service.Switch).getCharacteristic(characteristic).updateValue(state); @@ -428,7 +428,7 @@ class Handler { maxUl = `${(parseInt(response.Newmax_us) / 125000).toFixed(2)} Mbit/s`; } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -492,7 +492,7 @@ class Handler { logger.info('ON script executed successfully!', `${accessory.displayName} (${subtype})`); } catch (err) { logger.error('An error occured during executing ON script!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } @@ -506,7 +506,7 @@ class Handler { accessory.context.restart = true; } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -538,7 +538,7 @@ class Handler { logger.info('ON script executed successfully!', `${accessory.displayName} (${subtype})`); } catch (err) { logger.error('An error occured during executing ON script!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } @@ -552,7 +552,7 @@ class Handler { accessory.context.restart = true; } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -583,7 +583,7 @@ class Handler { await fritzbox.exec('urn:DeviceConfig-com:serviceId:DeviceConfig1', 'Reboot'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -613,7 +613,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -667,7 +667,7 @@ class Handler { await Promise.all(promises); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -696,7 +696,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -724,7 +724,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -750,7 +750,7 @@ class Handler { await fritzbox.exec(service, 'ForceTermination'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } finally { setTimeout( () => @@ -805,7 +805,7 @@ class Handler { await requestLUA(formData, fritzbox.url.hostname, '/data.lua'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -832,7 +832,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -870,7 +870,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -892,7 +892,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -936,7 +936,7 @@ class Handler { await requestLUA(formData, fritzbox.url.hostname, '/data.lua'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => @@ -966,7 +966,7 @@ class Handler { await requestLUA(formData, fritzbox.url.hostname, '/data.lua'); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); setTimeout( () => diff --git a/src/accessories/smarthome/smarthome-button.handler.js b/src/accessories/smarthome/smarthome-button.handler.js index 0c4847f..33f8773 100644 --- a/src/accessories/smarthome/smarthome-button.handler.js +++ b/src/accessories/smarthome/smarthome-button.handler.js @@ -132,7 +132,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } break; case 4: @@ -262,7 +262,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } break; default: @@ -290,7 +290,7 @@ class Handler { await this.get(accessory); } } catch (err) { - logger.warn('An error occurred during polling smarthome devices!'); + logger.warn('An error occurred during polling smarthome (button) devices!'); logger.error(err); } finally { setTimeout(() => this.poll(), this.polling.timerSmarthomeButtons * 1000); diff --git a/src/accessories/smarthome/smarthome.handler.js b/src/accessories/smarthome/smarthome.handler.js index a9a031a..cf008ad 100644 --- a/src/accessories/smarthome/smarthome.handler.js +++ b/src/accessories/smarthome/smarthome.handler.js @@ -358,7 +358,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } service.getCharacteristic(this.api.hap.Characteristic.On).updateValue(state); @@ -518,7 +518,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -665,7 +665,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } service.getCharacteristic(this.api.hap.Characteristic.On).updateValue(state); @@ -742,7 +742,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -806,7 +806,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -870,7 +870,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -912,7 +912,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -1061,7 +1061,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } return active; @@ -1104,7 +1104,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during getting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } accessory @@ -1260,7 +1260,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } break; @@ -1380,7 +1380,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } break; @@ -1423,7 +1423,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } break; @@ -1480,7 +1480,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } break; @@ -1548,7 +1548,7 @@ class Handler { } } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } } break; @@ -1647,7 +1647,7 @@ class Handler { .updateValue(2); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); accessory .getService(this.api.hap.Service.WindowCovering) diff --git a/src/accessories/wol/wol.handler.js b/src/accessories/wol/wol.handler.js index efbe0f4..bc78f2d 100644 --- a/src/accessories/wol/wol.handler.js +++ b/src/accessories/wol/wol.handler.js @@ -57,7 +57,7 @@ class Handler { }); } catch (err) { logger.warn('An error occured during setting state!', `${accessory.displayName} (${subtype})`); - logger.error(err); + logger.error(err, `${accessory.displayName} (${subtype})`); } finally { setTimeout( () =>