mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Add 'last seen' to BT advertisement montior (#24361)
* Add 'last seen' to BT advertisement montior * use ha-relative-time
This commit is contained in:
parent
9e1d64e728
commit
cc04457d72
@ -12,6 +12,7 @@ import type {
|
|||||||
} from "../../../../../components/data-table/ha-data-table";
|
} from "../../../../../components/data-table/ha-data-table";
|
||||||
import "../../../../../components/ha-fab";
|
import "../../../../../components/ha-fab";
|
||||||
import "../../../../../components/ha-icon-button";
|
import "../../../../../components/ha-icon-button";
|
||||||
|
import "../../../../../components/ha-relative-time";
|
||||||
import type {
|
import type {
|
||||||
BluetoothDeviceData,
|
BluetoothDeviceData,
|
||||||
BluetoothScannersDetails,
|
BluetoothScannersDetails,
|
||||||
@ -140,6 +141,18 @@ export class BluetoothAdvertisementMonitorPanel extends LitElement {
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
defaultHidden: true,
|
defaultHidden: true,
|
||||||
},
|
},
|
||||||
|
time: {
|
||||||
|
title: localize("ui.panel.config.bluetooth.last_seen"),
|
||||||
|
filterable: false,
|
||||||
|
sortable: true,
|
||||||
|
defaultHidden: false,
|
||||||
|
template: (ad) =>
|
||||||
|
html`<ha-relative-time
|
||||||
|
.hass=${this.hass}
|
||||||
|
.datetime=${ad.datetime}
|
||||||
|
capitalize
|
||||||
|
></ha-relative-time>`,
|
||||||
|
},
|
||||||
rssi: {
|
rssi: {
|
||||||
title: localize("ui.panel.config.bluetooth.rssi"),
|
title: localize("ui.panel.config.bluetooth.rssi"),
|
||||||
type: "numeric",
|
type: "numeric",
|
||||||
@ -167,6 +180,7 @@ export class BluetoothAdvertisementMonitorPanel extends LitElement {
|
|||||||
scanner?.name ||
|
scanner?.name ||
|
||||||
row.source,
|
row.source,
|
||||||
device: device?.name_by_user || device?.name || undefined,
|
device: device?.name_by_user || device?.name || undefined,
|
||||||
|
datetime: new Date(row.time * 1000),
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -5369,6 +5369,7 @@
|
|||||||
"source": "Source",
|
"source": "Source",
|
||||||
"rssi": "RSSI",
|
"rssi": "RSSI",
|
||||||
"source_address": "Source address",
|
"source_address": "Source address",
|
||||||
|
"last_seen": "Last seen",
|
||||||
"device": "Device",
|
"device": "Device",
|
||||||
"device_information": "Device information",
|
"device_information": "Device information",
|
||||||
"advertisement_data": "Advertisement data",
|
"advertisement_data": "Advertisement data",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user