Sha256: ac5739ac40469be1ddb6cc84553ae5be9e6d785691c02344a1071bc5692bdda8

Contents?: true

Size: 1.26 KB

Versions: 81

Compression:

Stored size: 1.26 KB

Contents

module Alula
  class DeviceSignalAddProc < Alula::RpcResource

    class Response < Alula::RpcResponse
      def initialize(response)
        super(response)
        #
        # This RPC response gives a new EventLog item
        data = response.data['result']['data'][0]
        @data = Alula::DeviceEventLog.new(data['id'], data['attributes'])
      end
    end

    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: signal_account_number,
        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
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
alula-ruby-2.6.1 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.6.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.5.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.4.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.3.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.2.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.1.2 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.1.1 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.1.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-2.0.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.5 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.4 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.3 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.2 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.1 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.10.0 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.9.17 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.9.16 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.9.15 lib/alula/procedures/device_signal_add_proc.rb
alula-ruby-1.9.14 lib/alula/procedures/device_signal_add_proc.rb