mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 06:47:20 +00:00
Add button for zwave_js options flow (#9001)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
This commit is contained in:
parent
c327fe11b8
commit
d93db16963
@ -29,6 +29,8 @@ import "../../../ha-config-section";
|
||||
import { showZWaveJSAddNodeDialog } from "./show-dialog-zwave_js-add-node";
|
||||
import { showZWaveJSRemoveNodeDialog } from "./show-dialog-zwave_js-remove-node";
|
||||
import { configTabs } from "./zwave_js-config-router";
|
||||
import { getConfigEntries } from "../../../../../data/config_entries";
|
||||
import { showOptionsFlowDialog } from "../../../../../dialogs/config-flow/show-dialog-options-flow";
|
||||
|
||||
@customElement("zwave_js-config-dashboard")
|
||||
class ZWaveJSConfigDashboard extends LitElement {
|
||||
@ -162,6 +164,11 @@ class ZWaveJSConfigDashboard extends LitElement {
|
||||
"ui.panel.config.zwave_js.common.remove_node"
|
||||
)}
|
||||
</mwc-button>
|
||||
<mwc-button @click=${this._openOptionFlow}>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.common.reconfigure_server"
|
||||
)}
|
||||
</mwc-button>
|
||||
</div>
|
||||
</ha-card>
|
||||
<ha-card>
|
||||
@ -262,6 +269,17 @@ class ZWaveJSConfigDashboard extends LitElement {
|
||||
);
|
||||
}
|
||||
|
||||
private async _openOptionFlow() {
|
||||
if (!this.configEntryId) {
|
||||
return;
|
||||
}
|
||||
const configEntries = await getConfigEntries(this.hass);
|
||||
const configEntry = configEntries.find(
|
||||
(entry) => entry.entry_id === this.configEntryId
|
||||
);
|
||||
showOptionsFlowDialog(this, configEntry!);
|
||||
}
|
||||
|
||||
private async _dumpDebugClicked() {
|
||||
await this._fetchNodeStatus();
|
||||
|
||||
|
@ -2587,7 +2587,8 @@
|
||||
"home_id": "Home ID",
|
||||
"close": "Close",
|
||||
"add_node": "Add Node",
|
||||
"remove_node": "Remove Node"
|
||||
"remove_node": "Remove Node",
|
||||
"reconfigure_server": "Re-configure Server"
|
||||
},
|
||||
"dashboard": {
|
||||
"header": "Manage your Z-Wave Network",
|
||||
|
Loading…
x
Reference in New Issue
Block a user