Remove unused zwave_js functions (#12915)

This commit is contained in:
Raman Gupta 2022-06-10 10:43:04 -04:00 committed by GitHub
parent 5baa975632
commit 74d6a52fa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
import { UnsubscribeFunc } from "home-assistant-js-websocket";
import { HomeAssistant } from "../types";
import { DeviceRegistryEntry } from "./device_registry";
export enum InclusionState {
/** The controller isn't doing anything regarding inclusion. */
@ -85,6 +84,7 @@ enum Protocols {
ZWave = 0,
ZWaveLongRange = 1,
}
export interface QRProvisioningInformation {
version: QRCodeVersion;
securityClasses: SecurityClass[];
@ -109,10 +109,6 @@ export interface PlannedProvisioningEntry {
export const MINIMUM_QR_STRING_LENGTH = 52;
export interface ZWaveJSNodeIdentifiers {
home_id: string;
node_id: number;
}
export interface ZWaveJSNetwork {
client: ZWaveJSClient;
controller: ZWaveJSController;
@ -315,25 +311,6 @@ export interface RequestedGrant {
export const nodeStatus = ["unknown", "asleep", "awake", "dead", "alive"];
export interface ZWaveJsMigrationData {
migration_device_map: Record<string, string>;
zwave_entity_ids: string[];
zwave_js_entity_ids: string[];
migration_entity_map: Record<string, string>;
migrated: boolean;
}
export const migrateZwave = (
hass: HomeAssistant,
entry_id: string,
dry_run = true
): Promise<ZWaveJsMigrationData> =>
hass.callWS({
type: "zwave_js/migrate_zwave",
entry_id,
dry_run,
});
export const fetchZwaveNetworkStatus = (
hass: HomeAssistant,
device_or_entry_id: {
@ -593,19 +570,6 @@ export const stopHealZwaveNetwork = (
entry_id,
});
export const subscribeZwaveNodeReady = (
hass: HomeAssistant,
device_id: string,
callbackFunction: (message) => void
): Promise<UnsubscribeFunc> =>
hass.connection.subscribeMessage(
(message: any) => callbackFunction(message),
{
type: "zwave_js/node_ready",
device_id,
}
);
export const subscribeHealZwaveNetworkProgress = (
hass: HomeAssistant,
entry_id: string,
@ -645,27 +609,6 @@ export const subscribeZwaveNodeStatistics = (
}
);
export const getZwaveJsIdentifiersFromDevice = (
device: DeviceRegistryEntry
): ZWaveJSNodeIdentifiers | undefined => {
if (!device) {
return undefined;
}
const zwaveJSIdentifier = device.identifiers.find(
(identifier) => identifier[0] === "zwave_js"
);
if (!zwaveJSIdentifier) {
return undefined;
}
const identifiers = zwaveJSIdentifier[1].split("-");
return {
node_id: parseInt(identifiers[1]),
home_id: identifiers[0],
};
};
export type ZWaveJSLogUpdate = ZWaveJSLogMessageUpdate | ZWaveJSLogConfigUpdate;
interface ZWaveJSLogMessageUpdate {