diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index ad69a73087..fb60450bb5 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -19,6 +19,7 @@ import { formatShortDateTime } from "../../../common/datetime/format_date_time"; import { storage } from "../../../common/decorators/storage"; import type { HASSDomEvent } from "../../../common/dom/fire_event"; import { computeDeviceNameDisplay } from "../../../common/entity/compute_device_name"; +import { computeFloorName } from "../../../common/entity/compute_floor_name"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { PROTOCOL_INTEGRATIONS, @@ -424,6 +425,18 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { (lbl) => labelReg!.find((label) => label.label_id === lbl)! ); + let floorName = "—"; + if ( + device.area_id && + areas[device.area_id]?.floor_id && + this.hass.floors + ) { + const floorId = areas[device.area_id].floor_id; + if (this.hass.floors[floorId!]) { + floorName = computeFloorName(this.hass.floors[floorId!]); + } + } + return { ...device, name: computeDeviceNameDisplay( @@ -441,6 +454,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { device.area_id && areas[device.area_id] ? areas[device.area_id].name : "—", + floor: floorName, integration: deviceEntries.length ? deviceEntries .map( @@ -524,6 +538,14 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { groupable: true, minWidth: "120px", }, + floor: { + title: localize("ui.panel.config.devices.data_table.floor"), + sortable: true, + filterable: true, + groupable: true, + minWidth: "120px", + defaultHidden: true, + }, integration: { title: localize("ui.panel.config.devices.data_table.integration"), sortable: true, diff --git a/src/translations/en.json b/src/translations/en.json index 37aad6e18d..ab4ca83702 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5138,6 +5138,7 @@ "manufacturer": "Manufacturer", "model": "Model", "area": "Area", + "floor": "Floor", "integration": "Integration", "battery": "Battery", "disabled_by": "Disabled",