Skip to content

Commit 6f94011

Browse files
author
Marc Sowen
committed
Reduced logs for some log messages.
1 parent 2219763 commit 6f94011

13 files changed

+24
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Improvements
44

55
- **HmIP-MOD**: Added "lightSwitch" config option to disable light switch if not available.
6+
- **General**: Reduced verbosity of log messages. Some frequent log messages have log level debug now.
67

78
### Bugfix
89

src/devices/HmIPBlind.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {CharacteristicGetCallback, CharacteristicSetCallback, CharacteristicValu
22

33
import {HmIPPlatform} from '../HmIPPlatform';
44
import {HmIPDevice, HmIPGroup, Updateable} from '../HmIPState';
5-
import {HmIPShutter} from "./HmIPShutter";
5+
import {HmIPShutter} from './HmIPShutter';
66

77
interface BlindChannel {
88
functionalChannelType: string;
@@ -66,9 +66,9 @@ export class HmIPBlind extends HmIPShutter implements Updateable {
6666
const blindChannel = <BlindChannel>channel;
6767

6868
const slatsLevelHomeKit = HmIPBlind.slatsHmIPToHomeKit(blindChannel.slatsLevel);
69-
if (slatsLevelHomeKit != this.slatsLevel) {
69+
if (slatsLevelHomeKit !== this.slatsLevel) {
7070
this.slatsLevel = slatsLevelHomeKit;
71-
this.platform.log.info('Current blind slats level of %s changed to %s°', this.accessory.displayName, this.slatsLevel.toFixed(0));
71+
this.platform.log.debug('Current blind slats level of %s changed to %s°', this.accessory.displayName, this.slatsLevel.toFixed(0));
7272
this.service.updateCharacteristic(this.platform.Characteristic.CurrentHorizontalTiltAngle, this.slatsLevel);
7373
this.service.updateCharacteristic(this.platform.Characteristic.TargetHorizontalTiltAngle, this.slatsLevel);
7474
}

src/devices/HmIPClimateSensor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ export class HmIPClimateSensor extends HmIPGenericDevice implements Updateable {
6767

6868
if (climateSensorChannel.actualTemperature !== this.actualTemperature) {
6969
this.actualTemperature = climateSensorChannel.actualTemperature;
70-
this.platform.log.info('Current temperature of %s changed to %s °C', this.accessory.displayName, this.actualTemperature);
70+
this.platform.log.debug('Current temperature of %s changed to %s °C', this.accessory.displayName, this.actualTemperature);
7171
this.temperatureService.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.actualTemperature);
7272
}
7373

7474
if (climateSensorChannel.humidity !== this.humidity) {
7575
this.humidity = climateSensorChannel.humidity;
76-
this.platform.log.info('Current relative humidity of %s changed to %s %%', this.accessory.displayName, this.humidity);
76+
this.platform.log.debug('Current relative humidity of %s changed to %s %%', this.accessory.displayName, this.humidity);
7777
this.humidityService.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.humidity);
7878
}
7979

src/devices/HmIPDimmer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class HmIPDimmer extends HmIPGenericDevice implements Updateable {
102102
}
103103

104104
this.brightness = brightness;
105-
this.platform.log.info('Brightness of %s changed to %s %%', this.accessory.displayName, this.brightness.toFixed(0));
105+
this.platform.log.debug('Brightness of %s changed to %s %%', this.accessory.displayName, this.brightness.toFixed(0));
106106
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.brightness);
107107
}
108108
}

src/devices/HmIPDoorLockDrive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class HmIPDoorLockDrive extends HmIPGenericDevice implements Updateable {
113113

114114
if (doorLockChannel.motorState !== null && doorLockChannel.motorState !== this.motorState) {
115115
this.motorState = doorLockChannel.motorState;
116-
this.platform.log.info('Door lock drive motor state of %s changed to %s', this.accessory.displayName, this.motorState);
116+
this.platform.log.debug('Door lock drive motor state of %s changed to %s', this.accessory.displayName, this.motorState);
117117
this.updateHmKitLockTargetState();
118118
this.service.updateCharacteristic(this.platform.Characteristic.LockTargetState, this.targetLockState);
119119
}

src/devices/HmIPGarageDoor.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export class HmIPGarageDoor extends HmIPGenericDevice implements Updateable {
4343
private service: Service;
4444
private switchService: Service | undefined;
4545

46-
private withLightSwitch = true;
4746
private currentDoorState: DoorState = DoorState.CLOSED;
4847
private previousDoorState: DoorState = DoorState.CLOSED;
4948
private processing = false;
@@ -56,8 +55,6 @@ export class HmIPGarageDoor extends HmIPGenericDevice implements Updateable {
5655
) {
5756
super(platform, accessory);
5857

59-
this.withLightSwitch = this.accessoryConfig?.['lightSwitch'] === true;
60-
6158
this.platform.log.debug(`Created garage door ${accessory.context.device.label}`);
6259
this.service = this.accessory.getService(this.platform.Service.GarageDoorOpener)
6360
|| this.accessory.addService(this.platform.Service.GarageDoorOpener);
@@ -73,7 +70,9 @@ export class HmIPGarageDoor extends HmIPGenericDevice implements Updateable {
7370
this.service.getCharacteristic(this.platform.Characteristic.ObstructionDetected)
7471
.on('get', this.handleObstructionDetectedGet.bind(this));
7572

76-
if (this.withLightSwitch) {
73+
const withLightSwitch = this.accessoryConfig?.['lightSwitch'] === true;
74+
75+
if (withLightSwitch) {
7776
this.switchService = this.accessory.getService(this.platform.Service.Switch)
7877
|| this.accessory.addService(this.platform.Service.Switch);
7978

@@ -149,7 +148,7 @@ export class HmIPGarageDoor extends HmIPGenericDevice implements Updateable {
149148

150149
if (doorChannel.processing !== null && doorChannel.processing !== this.processing) {
151150
this.processing = doorChannel.processing;
152-
this.platform.log.info('Garage door processing state of %s changed to %s', this.accessory.displayName, this.processing);
151+
this.platform.log.debug('Garage door processing state of %s changed to %s', this.accessory.displayName, this.processing);
153152
if (!this.processing && this.currentDoorState !== DoorState.OPEN && this.currentDoorState !== DoorState.CLOSED){
154153
this.service.updateCharacteristic(this.platform.Characteristic.CurrentDoorState,
155154
this.platform.Characteristic.CurrentDoorState.STOPPED);

src/devices/HmIPHeatingThermostat.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ export class HmIPHeatingThermostat extends HmIPGenericDevice implements Updateab
132132

133133
if (heatingThermostatChannel.setPointTemperature !== this.setPointTemperature) {
134134
this.setPointTemperature = heatingThermostatChannel.setPointTemperature;
135-
this.platform.log.info('Target temperature of %s changed to %s °C', this.accessory.displayName, this.setPointTemperature);
135+
this.platform.log.debug('Target temperature of %s changed to %s °C', this.accessory.displayName, this.setPointTemperature);
136136
this.service.updateCharacteristic(this.platform.Characteristic.TargetTemperature, this.setPointTemperature);
137137
}
138138

139139
if (heatingThermostatChannel.valveActualTemperature !== this.valveActualTemperature) {
140140
this.valveActualTemperature = heatingThermostatChannel.valveActualTemperature;
141-
this.platform.log.info('Current temperature of %s changed to %s °C', this.accessory.displayName, this.valveActualTemperature);
141+
this.platform.log.debug('Current temperature of %s changed to %s °C', this.accessory.displayName, this.valveActualTemperature);
142142
this.service.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.valveActualTemperature);
143143
}
144144

145145
if (heatingThermostatChannel.valvePosition !== this.valvePosition) {
146146
this.valvePosition = heatingThermostatChannel.valvePosition;
147-
this.platform.log.info('Current valve position of %s changed to %s', this.accessory.displayName, this.valvePosition);
147+
this.platform.log.debug('Current valve position of %s changed to %s', this.accessory.displayName, this.valvePosition);
148148
}
149149

150150
if (heatingThermostatChannel.valveState !== this.valveState) {

src/devices/HmIPLightSensor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class HmIPLightSensor extends HmIPGenericDevice implements Updateable {
5353

5454
if (lightSensorChannel.averageIllumination !== null && lightSensorChannel.averageIllumination !== this.averageIllumination) {
5555
this.averageIllumination = lightSensorChannel.averageIllumination;
56-
this.platform.log.info('Average light level of %s changed to %s lx', this.accessory.displayName, this.averageIllumination);
56+
this.platform.log.debug('Average light level of %s changed to %s lx', this.accessory.displayName, this.averageIllumination);
5757
this.service.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.averageIllumination);
5858
}
5959
}

src/devices/HmIPMotionDetector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class HmIPMotionDetector extends HmIPGenericDevice implements Updateable
7070

7171
if (motionDetectionChannel.motionDetected !== null && motionDetectionChannel.motionDetected !== this.motionDetected) {
7272
this.motionDetected = motionDetectionChannel.motionDetected;
73-
this.platform.log.info('Motion detector state of %s changed to %s', this.accessory.displayName, this.motionDetected);
73+
this.platform.log.debug('Motion detector state of %s changed to %s', this.accessory.displayName, this.motionDetected);
7474
this.service.updateCharacteristic(this.platform.Characteristic.MotionDetected, this.motionDetected);
7575
}
7676
}

src/devices/HmIPPresenceDetector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class HmIPPresenceDetector extends HmIPGenericDevice implements Updateabl
7070

7171
if (presenceDetectionChannel.presenceDetected !== null && presenceDetectionChannel.presenceDetected !== this.presenceDetected) {
7272
this.presenceDetected = presenceDetectionChannel.presenceDetected;
73-
this.platform.log.info('Presence detector state of %s changed to %s', this.accessory.displayName, this.presenceDetected);
73+
this.platform.log.debug('Presence detector state of %s changed to %s', this.accessory.displayName, this.presenceDetected);
7474
this.service.updateCharacteristic(this.platform.Characteristic.OccupancyDetected, this.presenceDetected
7575
? this.platform.Characteristic.OccupancyDetected.OCCUPANCY_DETECTED
7676
: this.platform.Characteristic.OccupancyDetected.OCCUPANCY_NOT_DETECTED);

0 commit comments

Comments
 (0)