mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +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 {
|
export interface ZHADevice {
|
||||||
name: string;
|
name: string;
|
||||||
ieee: string;
|
ieee: string;
|
||||||
|
nwk: string;
|
||||||
manufacturer: string;
|
manufacturer: string;
|
||||||
model: string;
|
model: string;
|
||||||
quirk_applied: boolean;
|
quirk_applied: boolean;
|
||||||
|
@ -36,10 +36,10 @@ class ZHAAddDevicesPage extends LitElement {
|
|||||||
|
|
||||||
public connectedCallback(): void {
|
public connectedCallback(): void {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
if (this.route && this.route.path && this.route.path !== "") {
|
this.route && this.route.path && this.route.path !== ""
|
||||||
this._ieeeAddress = this.route.path.substring(1);
|
? (this._ieeeAddress = this.route.path.substring(1))
|
||||||
}
|
: (this._ieeeAddress = undefined);
|
||||||
this._subscribe(this._ieeeAddress);
|
this._subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public disconnectedCallback(): void {
|
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" };
|
const data: any = { type: "zha/devices/permit" };
|
||||||
if (ieeeAddress) {
|
if (this._ieeeAddress) {
|
||||||
data.ieee = ieeeAddress;
|
data.ieee = this._ieeeAddress;
|
||||||
}
|
}
|
||||||
this._subscribed = this.hass!.connection.subscribeMessage(
|
this._subscribed = this.hass!.connection.subscribeMessage(
|
||||||
(message) => this._handleMessage(message),
|
(message) => this._handleMessage(message),
|
||||||
|
@ -36,6 +36,7 @@ import { HomeAssistant } from "../../../types";
|
|||||||
import { ItemSelectedEvent, NodeServiceData } from "./types";
|
import { ItemSelectedEvent, NodeServiceData } from "./types";
|
||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
import { UnsubscribeFunc } from "home-assistant-js-websocket";
|
||||||
|
import { formatAsPaddedHex } from "./functions";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// for fire event
|
// for fire event
|
||||||
@ -132,6 +133,8 @@ class ZHADeviceCard extends LitElement {
|
|||||||
<dl>
|
<dl>
|
||||||
<dt>IEEE:</dt>
|
<dt>IEEE:</dt>
|
||||||
<dd class="zha-info">${this.device!.ieee}</dd>
|
<dd class="zha-info">${this.device!.ieee}</dd>
|
||||||
|
<dt>Nwk:</dt>
|
||||||
|
<dd class="zha-info">${formatAsPaddedHex(this.device!.nwk)}</dd>
|
||||||
${
|
${
|
||||||
this.device!.quirk_applied
|
this.device!.quirk_applied
|
||||||
? html`
|
? html`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user