Correct ZHA LQI sort in device children dialog (#10616)

This commit is contained in:
David F. Mulcahey 2021-11-15 12:11:31 -05:00 committed by GitHub
parent 3154011c65
commit 4b992fb0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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 {

View File

@ -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",
}, },
}; };

View File

@ -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;
} }