diff --git a/futurehome/CHANGELOG.md b/futurehome/CHANGELOG.md index 8e55018..131b079 100644 --- a/futurehome/CHANGELOG.md +++ b/futurehome/CHANGELOG.md @@ -10,6 +10,7 @@ - Added support for 'barrier_ctrl' service (devices like garage doors, barriers, and window shades). - Added support for 'water_heater' service (devices such as water boiler or a water tank). - Updated demo mode data. +- Added extracting device manufacturer name. # 0.1.0 (24.07.2025) diff --git a/futurehome/src/fimp/vinculum_pd7_device.ts b/futurehome/src/fimp/vinculum_pd7_device.ts index 761465f..2636f44 100644 --- a/futurehome/src/fimp/vinculum_pd7_device.ts +++ b/futurehome/src/fimp/vinculum_pd7_device.ts @@ -4,9 +4,10 @@ export type VinculumPd7Device = { name?: string | null; } | null; id: number; - // "Model", e.g. "zb - _TZ3040_bb6xaihh - TS0202" + // "Model" string, e.g. "zb - _TZ3040_bb6xaihh - TS0202" + // The first one is the adapter, the second one is the manufacturer, the third one is the device model. model?: string | null; - // "Model alias", e.g. "TS0202" + // Device model, e.g. "TS0202" modelAlias?: string | null; functionality?: | 'appliance' diff --git a/futurehome/src/ha/publish_device.ts b/futurehome/src/ha/publish_device.ts index 3a2adfa..cf70303 100644 --- a/futurehome/src/ha/publish_device.ts +++ b/futurehome/src/ha/publish_device.ts @@ -259,12 +259,16 @@ export function haPublishDevice(parameters: { if (parameters.demoMode) { // Apply optimistic override for (const component of Object.values(components)) { - if ((component as any).optimistic === false) { - (component as any).optimistic = true; - } + (component as any).optimistic = true; } } + let vinculumManufacturer: string | undefined; + const parts = (parameters.vinculumDeviceData?.model ?? '').split(' - '); + if (parts.length === 3) { + vinculumManufacturer = parts[1]; + } + const configTopic = `${topicPrefix}/config`; const stateTopic = `${topicPrefix}/state`; const availabilityTopic = `${topicPrefix}/availability`; @@ -277,7 +281,9 @@ export function haPublishDevice(parameters: { parameters.deviceInclusionReport?.product_name ?? undefined, manufacturer: - parameters.deviceInclusionReport?.manufacturer_id ?? undefined, + vinculumManufacturer ?? + parameters.deviceInclusionReport?.manufacturer_id ?? + undefined, model: parameters.vinculumDeviceData?.modelAlias ?? parameters.deviceInclusionReport?.product_id ??