Class: Seam::Clients::NoiseSensors

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/noise_sensors.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ NoiseSensors

Returns a new instance of NoiseSensors.



6
7
8
9
# File 'lib/seam/routes/noise_sensors.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#list(connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_type: nil, device_types: nil, manufacturer: nil) ⇒ Seam::Resources::Device

Returns a list of all noise sensors.

Parameters:

  • connect_webview_id (String, nil) (defaults to: nil)

    ID of the Connect Webview for which you want to list devices.

  • connected_account_id (String, nil) (defaults to: nil)

    ID of the connected account for which you want to list devices.

  • customer_key (String, nil) (defaults to: nil)

    Customer key for which you want to list devices.

  • device_type (String, nil) (defaults to: nil)

    Device type of the noise sensors that you want to list.

  • device_types (Array<String>, nil) (defaults to: nil)

    Device types of the noise sensors that you want to list.

  • manufacturer (String, nil) (defaults to: nil)

    Manufacturers of the noise sensors that you want to list.

Returns:



27
28
29
30
31
# File 'lib/seam/routes/noise_sensors.rb', line 27

def list(connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_type: nil, device_types: nil, manufacturer: nil)
  res = @client.post("/noise_sensors/list", {connect_webview_id: connect_webview_id, connected_account_id: , customer_key: customer_key, device_type: device_type, device_types: device_types, manufacturer: manufacturer}.compact)

  Seam::Resources::Device.load_from_response(res.body["devices"])
end

#noise_thresholdsObject



11
12
13
# File 'lib/seam/routes/noise_sensors.rb', line 11

def noise_thresholds
  @noise_thresholds ||= Seam::Clients::NoiseSensorsNoiseThresholds.new(client: @client, defaults: @defaults)
end

#simulateObject



15
16
17
# File 'lib/seam/routes/noise_sensors.rb', line 15

def simulate
  @simulate ||= Seam::Clients::NoiseSensorsSimulate.new(client: @client, defaults: @defaults)
end