mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +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,
|
entry_id,
|
||||||
config: { level },
|
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 { getConfigEntries } from "../../../../../../data/config_entries";
|
||||||
import type { DeviceRegistryEntry } from "../../../../../../data/device_registry";
|
import type { DeviceRegistryEntry } from "../../../../../../data/device_registry";
|
||||||
import {
|
import {
|
||||||
|
fetchZwaveIntegrationSettings,
|
||||||
fetchZwaveIsAnyOTAFirmwareUpdateInProgress,
|
fetchZwaveIsAnyOTAFirmwareUpdateInProgress,
|
||||||
fetchZwaveIsNodeFirmwareUpdateInProgress,
|
fetchZwaveIsNodeFirmwareUpdateInProgress,
|
||||||
fetchZwaveNodeStatus,
|
fetchZwaveNodeStatus,
|
||||||
@ -99,17 +100,22 @@ export const getZwaveDeviceActions = async (
|
|||||||
showZWaveJSNodeStatisticsDialog(el, {
|
showZWaveJSNodeStatisticsDialog(el, {
|
||||||
device,
|
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 (
|
if (
|
||||||
!(
|
!(
|
||||||
nodeStatus.ready &&
|
nodeStatus.ready &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user