Module: Alula::DeviceHelpers::ProgramIdHelper

Included in:
Alula::Device
Defined in:
lib/alula/helpers/device_helpers/program_id_helper.rb

Overview

Helper methods for determining the device type based on the program ID

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#alder_wtp?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 78

def alder_wtp?
  program_id == 38
end

#bat_mini?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 94

def bat_mini?
  [39, 43].include?(program_id)
end

#connect_device?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 62

def connect_device?
  self.class::CONNECT_PROGRAM_IDS.include?(program_id)
end

#connect_xip?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 90

def connect_xip?
  program_id == 36
end

#connect_xt?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 74

def connect_xt?
  program_id == 33
end

#eufy_camera?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 86

def eufy_camera?
  self.class::EUFY_CAMERA_PROGRAM_IDS.include?(program_id)
end

#gsm_device?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 70

def gsm_device?
  self.class::GSM_PROGRAM_IDS.include?(program_id)
end

#kami_camera?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 82

def kami_camera?
  self.class::KAMI_CAMERA_PROGRAM_IDS.include?(program_id)
end

#legacy_device?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 66

def legacy_device?
  !connect_device?
end

#xip_family?Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/alula/helpers/device_helpers/program_id_helper.rb', line 98

def xip_family?
  self.class::XIP_FAMILY_PROGRAM_IDS.include?(program_id)
end