mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +00:00
Show ZwaveJS "Installer settings" based on installer_mode
option (#22710)
Show "Installer settings" based on `installer_mode` option
This commit is contained in:
parent
940cbd42c3
commit
c92bee4f1d
@ -951,3 +951,14 @@ export const setZWaveJSLogLevel = (
|
||||
entry_id,
|
||||
config: { level },
|
||||
});
|
||||
|
||||
export interface ZWaveJSIntegrationSettings {
|
||||
installer_mode: boolean;
|
||||
}
|
||||
|
||||
export const fetchZwaveIntegrationSettings = (
|
||||
hass: HomeAssistant
|
||||
): Promise<ZWaveJSIntegrationSettings> =>
|
||||
hass.callWS({
|
||||
type: "zwave_js/get_integration_settings",
|
||||
});
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
import { getConfigEntries } from "../../../../../../data/config_entries";
|
||||
import type { DeviceRegistryEntry } from "../../../../../../data/device_registry";
|
||||
import {
|
||||
fetchZwaveIntegrationSettings,
|
||||
fetchZwaveIsAnyOTAFirmwareUpdateInProgress,
|
||||
fetchZwaveIsNodeFirmwareUpdateInProgress,
|
||||
fetchZwaveNodeStatus,
|
||||
@ -99,17 +100,22 @@ export const getZwaveDeviceActions = async (
|
||||
showZWaveJSNodeStatisticsDialog(el, {
|
||||
device,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: hass.localize(
|
||||
"ui.panel.config.zwave_js.device_info.installer_settings"
|
||||
),
|
||||
icon: mdiWrench,
|
||||
href: `/config/zwave_js/node_installer/${device.id}?config_entry=${entryId}`,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const integrationSettings = await fetchZwaveIntegrationSettings(hass);
|
||||
|
||||
if (integrationSettings.installer_mode) {
|
||||
actions.push({
|
||||
label: hass.localize(
|
||||
"ui.panel.config.zwave_js.device_info.installer_settings"
|
||||
),
|
||||
icon: mdiWrench,
|
||||
href: `/config/zwave_js/node_installer/${device.id}?config_entry=${entryId}`,
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
!(
|
||||
nodeStatus.ready &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user