# frozen_string_literal: true module Alula module DeviceHelpers # Helper methods for determining the device type based on the program ID module ProgramIdHelper CONNECT_PROGRAM_IDS = [ 211, # D3 4096, # Camera 35, # BAT-FIRE 34, # BAT-CONNECT 33, # CONNECT-XT 32, # CONNECT+ 36, # CONNECT-XiP 38, # WTP-01 (is ALDER-WTP) 39, # BAT-Mini 40, # CONNECT-FLX 41, # CONNECT+PRO 42, # CONNECT+PRO-SC 43, # BAT-Mini AV 44, # WTP-02 (is ALDER-WTP_WIFI) 45, # Connect-FLX-Z 46, # Connect-FLX-DUAL 47 # Connect-FLX-DUAL-Z ].freeze GSM_PROGRAM_IDS = [ 15, 271, # IPD-BAT-CDMA 16, 272, # IPD-BAT-CDMA-WIFI 17, # IPD-BAT-CDMA-L 783, # BAT-LTE 788 # BAT-LTE-WIFI ].freeze KAMI_CAMERA_PROGRAM_IDS = [ 3072, 3073, 3074, 3075, 3076, 3090 ].freeze EUFY_CAMERA_PROGRAM_IDS = [ 3086, 3087, 3088, 3089, 3091 ].freeze XIP_FAMILY_PROGRAM_IDS = [ 36, # CONNECT-XiP 40, # C+Flex 41, # C+Pro 42, # C+Pro-SC 45, # C+Flex-Z 46, # C+Flex-Dual 47 # C+Flex-Dual-Z ].freeze def connect_device? self.class::CONNECT_PROGRAM_IDS.include?(program_id) end def legacy_device? !connect_device? end def gsm_device? self.class::GSM_PROGRAM_IDS.include?(program_id) end def connect_xt? program_id == 33 end def alder_wtp? program_id == 38 end def kami_camera? self.class::KAMI_CAMERA_PROGRAM_IDS.include?(program_id) end def eufy_camera? self.class::EUFY_CAMERA_PROGRAM_IDS.include?(program_id) end def connect_xip? program_id == 36 end def bat_mini? [39, 43].include?(program_id) end def xip_family? self.class::XIP_FAMILY_PROGRAM_IDS.include?(program_id) end end end end