From 74d6a52fa99c2bc1279bd8cc993506d964b14009 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Fri, 10 Jun 2022 10:43:04 -0400 Subject: [PATCH] Remove unused zwave_js functions (#12915) --- src/data/zwave_js.ts | 59 +------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/src/data/zwave_js.ts b/src/data/zwave_js.ts index c3f3919e1f..292cbf8402 100644 --- a/src/data/zwave_js.ts +++ b/src/data/zwave_js.ts @@ -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; - zwave_entity_ids: string[]; - zwave_js_entity_ids: string[]; - migration_entity_map: Record; - migrated: boolean; -} - -export const migrateZwave = ( - hass: HomeAssistant, - entry_id: string, - dry_run = true -): Promise => - 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 => - 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 {