diff --git a/config.schema.json b/config.schema.json index d8999de..cfcff58 100644 --- a/config.schema.json +++ b/config.schema.json @@ -8,6 +8,7 @@ "properties": { "name": { "title": "Name", + "description": "A unique name for the platform", "type": "string", "required": true, "default": "Teslemetry" @@ -16,6 +17,13 @@ "title": "Access Token", "type": "string", "required": true + }, + "prefixName": { + "title": "Prefix Name", + "description": "Prefix the name of each service with the name of the vehicle", + "type": "boolean", + "required": false, + "default": true } } } diff --git a/src/vehicle-services/base.ts b/src/vehicle-services/base.ts index cff12ef..6eae2be 100644 --- a/src/vehicle-services/base.ts +++ b/src/vehicle-services/base.ts @@ -24,7 +24,7 @@ export abstract class BaseService { this.emitter = parent.emitter; this.vehicle = parent.vehicle; - name = `${this.parent.accessory.displayName} ${name}`; + name = parent.platform.config.prefixName ? `${this.parent.accessory.displayName} ${name}` : name; if (this.accessory.getServiceById(definition, subtype)) { this.log.info(`Restoring service ${name}`);