${localize( "ui.panel.config.integrations.config_flow.found_following_devices" )}:
${!device.model && !device.manufacturer ? html` ` : html`${device.model} ${device.manufacturer ? html`(${device.manufacturer})` : ""}`}
import "@material/mwc-button"; import { css, CSSResultGroup, html, LitElement, PropertyValues, TemplateResult, } from "lit"; import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-area-picker"; import { DataEntryFlowStepCreateEntry } from "../../data/data_entry_flow"; import { computeDeviceName, DeviceRegistryEntry, updateDeviceRegistryEntry, } from "../../data/device_registry"; import { EntityRegistryDisplayEntry } from "../../data/entity_registry"; import { HomeAssistant } from "../../types"; import { showAlertDialog } from "../generic/show-dialog-box"; import { FlowConfig } from "./show-dialog-data-entry-flow"; import { configFlowContentStyles } from "./styles"; import { computeDomain } from "../../common/entity/compute_domain"; import { showVoiceAssistantSetupDialog } from "../voice-assistant-setup/show-voice-assistant-setup-dialog"; import { assistSatelliteSupportsSetupFlow } from "../../data/assist_satellite"; @customElement("step-flow-create-entry") class StepFlowCreateEntry extends LitElement { @property({ attribute: false }) public flowConfig!: FlowConfig; @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public step!: DataEntryFlowStepCreateEntry; @property({ attribute: false }) public devices!: DeviceRegistryEntry[]; private _deviceEntities = memoizeOne( ( deviceId: string, entities: EntityRegistryDisplayEntry[], domain?: string ): EntityRegistryDisplayEntry[] => entities.filter( (entity) => entity.device_id === deviceId && (!domain || computeDomain(entity.entity_id) === domain) ) ); protected willUpdate(changedProps: PropertyValues) { if ( (changedProps.has("devices") || changedProps.has("hass")) && this.devices.length === 1 ) { // integration_type === "device" const assistSatellites = this._deviceEntities( this.devices[0].id, Object.values(this.hass.entities), "assist_satellite" ); if ( assistSatellites.length && assistSatellites.some((satellite) => assistSatelliteSupportsSetupFlow( this.hass.states[satellite.entity_id] ) ) ) { this._flowDone(); showVoiceAssistantSetupDialog(this, { deviceId: this.devices[0].id, }); } } } protected render(): TemplateResult { const localize = this.hass.localize; return html`
${localize( "ui.panel.config.integrations.config_flow.found_following_devices" )}: