Sha256: 00d90472d702459f4caf7625856dbdd05039e4762858b368b12a76b93482f0f8
Contents?: true
Size: 1.85 KB
Versions: 71
Compression:
Stored size: 1.85 KB
Contents
module Alula # # Relies on the implementing class having reader properties of `program_id` # and `auto_cfg`. Translates those values into usable strings module DeviceAttributeTranslations PROGRAM_ID_MAP = { 32 => 'CONNECT+', 35 => 'BAT-FIRE', 34 => 'BAT-CONNECT', 211 => 'CLARE-D3', 4096 => 'CAMERA', 783 => 'BAT-LTE', 0 => 'IPD-BAT', 1 => 'IPD-BAT', 2 => 'IPD-BAT', 3 => 'IPD-BAT-ZKI', 4 => 'IPD-BAT', 8 => 'IPD-BAT', 6 => 'IPD-ZGW', 9 => 'IPD-BAT-U', 11 => 'IPD-ZGW', 15 => 'IPD-BAT-CDMA', 16 => 'IPD-BAT-WIFI', 17 => 'IPD-BAT-CDMA-L', 18 => 'IPD-MPWC', 19 => 'IPD-CAT-CDMA', 20 => 'IPD-BAT-CDMA-WIFI', 22 => 'IPD-CAT-XT', 33 => 'IGM', 271 => 'IPD-BAT-CDMA1' }.freeze PANEL_NAME_MAP = { 0 => 'Honeywell/Vista', 1 => 'Honeywell/Vista+Passive', 2 => 'Honeywell/Lynx', 3 => 'Honeywell/Lynx+Passive', 4 => 'DSC/Depricated', 5 => 'GE-Interlogix/Caddx', 6 => 'DSC/Alexor', 7 => 'DSC/PowerSeries', 8 => 'Dialer Capture or Keyswitch', 9 => 'GE-Interlogix/Concord', 10 => '', 11 => 'Gateway', 12 => 'GE Simon XT/XTi', 13 => 'Cinch', 14 => 'Helix', 15 => 'Clare D3', 19 => 'No Panel', }.freeze def device_name self.class::PROGRAM_ID_MAP[self.program_id] || "Unknown (#{self.program_id})" end # # autoCfg contains multiple pieces of information depending on how you examine it. # Doing a bitwise operation with 0xff takes the last 8 bits, # which is the connected panel ID. # https://ipdatatel.atlassian.net/wiki/spaces/SYS/pages/16482314/auto+cfg def panel_name panel_id = auto_cfg.to_i & 0xff self.class::PANEL_NAME_MAP[panel_id] || "Unknown (#{panel_id})" end end end
Version data entries
71 entries across 71 versions & 1 rubygems