Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node details shortcut to OZW device pages #6791

Merged
merged 4 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
OZWNodeIdentifiers,
} from "../../../../../../data/ozw";
import { showOZWRefreshNodeDialog } from "../../../../integrations/integration-panels/ozw/show-dialog-ozw-refresh-node";
import { navigate } from "../../../../../../common/navigate";
import "@material/mwc-button/mwc-button";

@customElement("ha-device-info-ozw")
export class HaDeviceInfoOzw extends LitElement {
Expand Down Expand Up @@ -83,8 +85,11 @@ export class HaDeviceInfoOzw extends LitElement {
? this.hass.localize("ui.common.yes")
: this.hass.localize("ui.common.no")}
</div>
<mwc-button @click=${this._nodeDetailsClicked}>
${this.hass.localize("ui.panel.config.ozw.node.button")}
</mwc-button>
<mwc-button @click=${this._refreshNodeClicked}>
Refresh Node
${this.hass.localize("ui.panel.config.ozw.refresh_node.button")}
</mwc-button>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in device actions, so it is styled correctly. Check zha for example.

`;
}
Expand All @@ -96,6 +101,13 @@ export class HaDeviceInfoOzw extends LitElement {
});
}

private async _nodeDetailsClicked() {
navigate(
this,
`/config/ozw/network/${this.ozw_instance}/node/${this.node_id}/dashboard`
);
}

static get styles(): CSSResult[] {
return [
haStyle,
Expand Down
2 changes: 2 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@
"complete": "Interview process is complete"
},
"refresh_node": {
"button": "Refresh Node",
"title": "Refresh Node Information",
"complete": "Node Refresh Complete",
"description": "This will tell OpenZWave to re-interview a node and update the node's command classes, capabilities, and values.",
Expand Down Expand Up @@ -1813,6 +1814,7 @@
"failed": "Failed"
},
"node": {
"button": "Node Details",
"not_found": "Node not found"
},
"services": {
Expand Down