mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 06:17:20 +00:00
Correct ZHA LQI sort in device children dialog (#10616)
This commit is contained in:
parent
3154011c65
commit
4b992fb0c4
@ -34,7 +34,7 @@ export interface ZHADevice {
|
|||||||
export interface Neighbor {
|
export interface Neighbor {
|
||||||
ieee: string;
|
ieee: string;
|
||||||
nwk: string;
|
nwk: string;
|
||||||
lqi: number;
|
lqi: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ZHADeviceEndpoint {
|
export interface ZHADeviceEndpoint {
|
||||||
|
@ -43,7 +43,7 @@ class DialogZHADeviceChildren extends LitElement {
|
|||||||
outputDevices.push({
|
outputDevices.push({
|
||||||
name: zhaDevice.user_given_name || zhaDevice.name,
|
name: zhaDevice.user_given_name || zhaDevice.name,
|
||||||
id: zhaDevice.device_reg_id,
|
id: zhaDevice.device_reg_id,
|
||||||
lqi: child.lqi,
|
lqi: parseInt(child.lqi),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -64,7 +64,7 @@ class DialogZHADeviceChildren extends LitElement {
|
|||||||
title: "LQI",
|
title: "LQI",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
direction: "asc",
|
type: "numeric",
|
||||||
width: "75px",
|
width: "75px",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -233,11 +233,11 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
|||||||
from: device.ieee,
|
from: device.ieee,
|
||||||
to: neighbor.ieee,
|
to: neighbor.ieee,
|
||||||
label: neighbor.lqi + "",
|
label: neighbor.lqi + "",
|
||||||
color: this._getLQI(neighbor.lqi),
|
color: this._getLQI(parseInt(neighbor.lqi)),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
edges[idx].color = this._getLQI(
|
edges[idx].color = this._getLQI(
|
||||||
(parseInt(edges[idx].label!) + neighbor.lqi) / 2
|
(parseInt(edges[idx].label!) + parseInt(neighbor.lqi)) / 2
|
||||||
);
|
);
|
||||||
edges[idx].label += "/" + neighbor.lqi;
|
edges[idx].label += "/" + neighbor.lqi;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user