mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Add NWK to ZHA device card and fix search again (#3278)
* add nwk to device info * fix search again
This commit is contained in:
parent
d8e0fd0ba5
commit
dd56671974
@ -8,6 +8,7 @@ export interface ZHAEntityReference extends HassEntity {
|
||||
export interface ZHADevice {
|
||||
name: string;
|
||||
ieee: string;
|
||||
nwk: string;
|
||||
manufacturer: string;
|
||||
model: string;
|
||||
quirk_applied: boolean;
|
||||
|
@ -36,10 +36,10 @@ class ZHAAddDevicesPage extends LitElement {
|
||||
|
||||
public connectedCallback(): void {
|
||||
super.connectedCallback();
|
||||
if (this.route && this.route.path && this.route.path !== "") {
|
||||
this._ieeeAddress = this.route.path.substring(1);
|
||||
}
|
||||
this._subscribe(this._ieeeAddress);
|
||||
this.route && this.route.path && this.route.path !== ""
|
||||
? (this._ieeeAddress = this.route.path.substring(1))
|
||||
: (this._ieeeAddress = undefined);
|
||||
this._subscribe();
|
||||
}
|
||||
|
||||
public disconnectedCallback(): void {
|
||||
@ -156,10 +156,10 @@ class ZHAAddDevicesPage extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private _subscribe(ieeeAddress: string | undefined): void {
|
||||
private _subscribe(): void {
|
||||
const data: any = { type: "zha/devices/permit" };
|
||||
if (ieeeAddress) {
|
||||
data.ieee = ieeeAddress;
|
||||
if (this._ieeeAddress) {
|
||||
data.ieee = this._ieeeAddress;
|
||||
}
|
||||
this._subscribed = this.hass!.connection.subscribeMessage(
|
||||
(message) => this._handleMessage(message),
|
||||
|
@ -36,6 +36,7 @@ import { HomeAssistant } from "../../../types";
|
||||
import { ItemSelectedEvent, NodeServiceData } from "./types";
|
||||
import { navigate } from "../../../common/navigate";
|
||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||
import { formatAsPaddedHex } from "./functions";
|
||||
|
||||
declare global {
|
||||
// for fire event
|
||||
@ -132,6 +133,8 @@ class ZHADeviceCard extends LitElement {
|
||||
<dl>
|
||||
<dt>IEEE:</dt>
|
||||
<dd class="zha-info">${this.device!.ieee}</dd>
|
||||
<dt>Nwk:</dt>
|
||||
<dd class="zha-info">${formatAsPaddedHex(this.device!.nwk)}</dd>
|
||||
${
|
||||
this.device!.quirk_applied
|
||||
? html`
|
||||
|
Loading…
x
Reference in New Issue
Block a user