Skip to content

Commit ad413b3

Browse files
committed
Update homekit startup messages
1 parent b467b02 commit ad413b3

14 files changed

Lines changed: 49 additions & 61 deletions

File tree

src/homebridge/platform.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
2424
private readonly log: Log;
2525

2626
private readonly homekitAccessories: Map<string, HomeKitAccessory> = new Map();
27-
private readonly accessories: (BaseAccessory<BaseAccessoryConfig> | GroupAccessory)[] = [];
27+
28+
private readonly mqttAccessories: (BaseAccessory<BaseAccessoryConfig> | GroupAccessory)[] = [];
2829

2930
constructor(
3031
logger: Logger,
@@ -37,12 +38,13 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
3738
this.log = new Log(logger, config.verbose);
3839

3940
this.log.ifVerbose(
40-
'v%s | System %s | Node %s | HB v%s | HAPNodeJS v%s',
41+
'v%s | System %s | Node %s | HB v%s | HAPNodeJS v%s | Matter %s',
4142
getVersion(),
4243
process.platform,
4344
process.version,
4445
api.serverVersion,
4546
api.hap.HAPLibraryVersion(),
47+
api.isMatterEnabled?.() === true ? 'Enabled' : 'Disabled',
4648
);
4749

4850
initEveCharacteristics(api);
@@ -57,12 +59,12 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
5759
}
5860

5961
configureAccessory(accessory: HomeKitAccessory): void {
60-
this.log.ifVerbose(strings.startup.restoringAccessory, accessory.displayName);
62+
this.log.ifVerbose(strings.startup.restoringHomeKitAccessory, accessory.displayName);
6163
this.homekitAccessories.set(accessory.context.identifier, accessory);
6264
}
6365

6466
private teardown() {
65-
this.accessories.forEach( accessory => {
67+
this.mqttAccessories.forEach( accessory => {
6668
accessory.teardown();
6769
});
6870
}
@@ -120,7 +122,7 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
120122
}
121123

122124
keepIdentifiers.add(uuid);
123-
this.accessories.push(accessory);
125+
this.mqttAccessories.push(accessory);
124126
}
125127

126128
for (const groupName of groups.keys()) {
@@ -140,17 +142,14 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
140142
const groupAccessory = new GroupAccessory(dependency, groupName, configs);
141143

142144
keepIdentifiers.add(uuid);
143-
this.accessories.push(groupAccessory);
145+
this.mqttAccessories.push(groupAccessory);
144146
}
145147

146148
this.homekitAccessories.forEach(accessory => {
147149
if (!keepIdentifiers.has(accessory.context.identifier)) {
148150
this.removeHomeKitAccessory(accessory);
149151
}
150152
});
151-
152-
const randIndex = Math.floor(Math.random() * strings.startup.welcome.length);
153-
this.log.always(`${strings.startup.complete}\n${strings.startup.welcome[randIndex]}`);
154153
}
155154

156155
private createHomeKitAccessory(name: string, uuid: string): HomeKitAccessory {
@@ -165,7 +164,7 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
165164

166165
this.homekitAccessories.set(uuid, homekitAccessory);
167166

168-
this.log.always(strings.startup.newAccessory, name);
167+
this.log.always(strings.startup.newHomeKitAccessory, name);
169168
}
170169

171170
if (name !== homekitAccessory.displayName) {
@@ -176,7 +175,7 @@ export class HomebridgeEasyMQTT implements DynamicPlatformPlugin {
176175
}
177176

178177
private removeHomeKitAccessory(accessory: HomeKitAccessory) {
179-
this.log.always(strings.startup.removeAccessory, accessory.displayName);
178+
this.log.always(strings.startup.removeHomeKitAccessory, accessory.displayName);
180179
this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);
181180
this.homekitAccessories.delete(accessory.context.identifier);
182181
}

src/i18n/da.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,7 @@ const da = {
604604

605605
startup: {
606606
complete: '✓ Opsætning fuldført',
607-
newAccessory: 'Tilføjer %s',
608-
removeAccessory: 'Fjerner %s',
609-
restoringAccessory: 'Gendanner %s',
610607
unsupportedType: 'Ikke-understøttet tilbehørstype %s',
611-
welcome: [
612-
'Giv venligst dette plugin en ★ på GitHub, hvis du finder det nyttigt! https://github.com/mpatfield/homebridge-easy-mqtt',
613-
'Vil du sponsorere dette plugin? https://github.com/sponsors/mpatfield',
614-
],
615608
},
616609

617610
thermostat: {

src/i18n/de.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,7 @@ const de = {
604604

605605
startup: {
606606
complete: '✓ Setup abgeschlossen für %s',
607-
newAccessory: 'Füge %s hinzu',
608-
removeAccessory: 'Entferne %s',
609-
restoringAccessory: 'Stelle %s wieder her',
610607
unsupportedType: 'Nicht unterstützter Zubehörtyp %s',
611-
welcome: [
612-
'Bitte ★ dieses Plugin auf GitHub, wenn Sie es nützlich finden! https://github.com/mpatfield/homebridge-easy-mqtt',
613-
'Möchten Sie dieses Plugin sponsern? https://github.com/sponsors/mpatfield',
614-
],
615608
},
616609

617610
thermostat: {

src/i18n/en.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -619,15 +619,10 @@ const en = {
619619

620620
startup: {
621621
complete: '✓ Setup complete',
622-
newAccessory: 'Adding %s', // accessory name
623-
removeAccessory: 'Removing %s', // accessory name
624-
restoringAccessory: 'Restoring %s', // accessory name
622+
newHomeKitAccessory: 'Adding new HomeKit accessory:',
623+
removeHomeKitAccessory: 'Removing HomeKit accessory:',
624+
restoringHomeKitAccessory: 'Restoring HomeKit accessory:',
625625
unsupportedType: 'Unsupported accessory type %s', // accessory type
626-
welcome: [
627-
'Please ★ this plugin on GitHub if you\'re finding it useful! https://github.com/mpatfield/homebridge-easy-mqtt',
628-
'Would you like to sponsor this plugin? https://github.com/sponsors/mpatfield',
629-
'Want to see this plugin in your own language? Please visit https://github.com/mpatfield/homebridge-easy-mqtt/issues/4',
630-
],
631626
},
632627

633628
thermostat: {

src/i18n/fr.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,7 @@ const fr = {
604604

605605
startup: {
606606
complete: '✓ Configuration terminée',
607-
newAccessory: 'Ajout de %s',
608-
removeAccessory: 'Suppression de %s',
609-
restoringAccessory: 'Restauration de %s',
610607
unsupportedType: 'Type d\'accessoire non pris en charge %s',
611-
welcome: [
612-
'Veuillez ★ ce plugin sur GitHub si vous le trouvez utile ! https://github.com/mpatfield/homebridge-easy-mqtt',
613-
'Souhaitez-vous parrainer ce plugin ? https://github.com/sponsors/mpatfield',
614-
],
615608
},
616609

617610
thermostat: {

src/i18n/it.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,7 @@ const it = {
478478

479479
startup: {
480480
complete: '✓ Configurazione completata',
481-
newAccessory: 'Aggiunta %s',
482-
removeAccessory: 'Rimozione %s',
483-
restoringAccessory: 'Ripristino %s',
484481
unsupportedType: 'Tipo di accessorio non supportato %s',
485-
welcome: [
486-
'Per favore ★ questo plugin su GitHub se lo trovi utile! https://github.com/mpatfield/homebridge-easy-mqtt',
487-
'Vuoi sponsorizzare questo plugin? https://github.com/sponsors/mpatfield',
488-
],
489482
},
490483

491484
thermostat: {

src/i18n/missing/da.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const da = {
2525
},
2626
},
2727

28+
startup: {
29+
newHomeKitAccessory: 'Adding new HomeKit accessory:',
30+
removeHomeKitAccessory: 'Removing HomeKit accessory:',
31+
restoringHomeKitAccessory: 'Restoring HomeKit accessory:',
32+
},
33+
2834
valve: {
2935
durationTopicsIgnored: '%s is using a built-in timer, so duration topics %s will be ignored', // accessory name, list of topics
3036
},

src/i18n/missing/de.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const de = {
2525
},
2626
},
2727

28+
startup: {
29+
newHomeKitAccessory: 'Adding new HomeKit accessory:',
30+
removeHomeKitAccessory: 'Removing HomeKit accessory:',
31+
restoringHomeKitAccessory: 'Restoring HomeKit accessory:',
32+
},
33+
2834
valve: {
2935
durationTopicsIgnored: '%s is using a built-in timer, so duration topics %s will be ignored', // accessory name, list of topics
3036
},

src/i18n/missing/fr.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const fr = {
2525
},
2626
},
2727

28+
startup: {
29+
newHomeKitAccessory: 'Adding new HomeKit accessory:',
30+
removeHomeKitAccessory: 'Removing HomeKit accessory:',
31+
restoringHomeKitAccessory: 'Restoring HomeKit accessory:',
32+
},
33+
2834
valve: {
2935
durationTopicsIgnored: '%s is using a built-in timer, so duration topics %s will be ignored', // accessory name, list of topics
3036
},

src/i18n/missing/it.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ const it = {
174174

175175
},
176176

177+
startup: {
178+
newHomeKitAccessory: 'Adding new HomeKit accessory:',
179+
removeHomeKitAccessory: 'Removing HomeKit accessory:',
180+
restoringHomeKitAccessory: 'Restoring HomeKit accessory:',
181+
},
182+
177183
valve: {
178184
durationTopicsIgnored: '%s is using a built-in timer, so duration topics %s will be ignored', // accessory name, list of topics
179185
},

0 commit comments

Comments
 (0)