Class: Alula::DeviceSignalAddProc

Inherits:
RpcResource show all
Defined in:
lib/alula/procedures/device_signal_add_proc.rb

Defined Under Namespace

Classes: Response

Class Method Summary collapse

Methods inherited from RpcResource

ok?, request, wrap_payload

Class Method Details

.call(action:, customer_id:, dealer_id:, device_id:, group_id:, log_format:, mac:, relay_status:, signal_account_number:, signal_event_code:, signal_event_qualifier:, signal_partition:, signal_user_zone:, sn:) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/alula/procedures/device_signal_add_proc.rb', line 14

def self.call(action:, customer_id:, dealer_id:, device_id:, group_id:, log_format:,
              mac:, relay_status:, signal_account_number:, signal_event_code:, signal_event_qualifier:,
              signal_partition:, signal_user_zone:, sn:)
  payload = {
    action: action,
    customerId: customer_id,
    dealerId: dealer_id,
    deviceId: device_id,
    groupId: group_id,
    logFormat: log_format,
    mac: mac,
    relayStatus: relay_status,
    signalAccountNumber: ,
    signalEventCode: signal_event_code,
    signalEventQualifier: signal_event_qualifier,
    signalPartition: signal_partition,
    signalUserZone: signal_user_zone,
    sn: sn,
  }

  request( 
    http_method: :post,
    path: '/rpc/v1/devices/signal/add',
    payload: payload,
    handler: Response
  )
end