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, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) ⇒ Seam::Resources::Device

Deprecated.

unstable_location_id: Use space_id.

Returns a list of all noise sensors.

Parameters:

  • connect_webview_id (defaults to: nil)

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

  • connected_account_id (defaults to: nil)

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

  • connected_account_ids (defaults to: nil)

    Array of IDs of the connected accounts for which you want to list devices.

  • created_before (defaults to: nil)

    Timestamp by which to limit returned devices. Returns devices created before this timestamp.

  • custom_metadata_has (defaults to: nil)

    Set of key:value custom metadata pairs for which you want to list devices.

  • customer_key (defaults to: nil)

    Customer key for which you want to list devices.

  • device_ids (defaults to: nil)

    Array of device IDs for which you want to list devices.

  • device_type (defaults to: nil)

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

  • device_types (defaults to: nil)

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

  • limit (defaults to: nil)

    Numerical limit on the number of devices to return.

  • manufacturer (defaults to: nil)

    Manufacturers of the noise sensors that you want to list.

  • page_cursor (defaults to: nil)

    Identifies the specific page of results to return, obtained from the previous page's next_page_cursor.

  • search (defaults to: nil)

    String for which to search. Filters returned devices to include all records that satisfy a partial match using device_id (full or partial UUID prefix, minimum 4 characters), connected_account_id, display_name, custom_metadata or location.location_name.

  • space_id (defaults to: nil)

    ID of the space for which you want to list devices.

  • unstable_location_id (defaults to: nil)
  • user_identifier_key (defaults to: nil)

    Your own internal user ID for the user for which you want to list devices.

Returns:



38
39
40
41
42
# File 'lib/seam/routes/noise_sensors.rb', line 38

def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil)
  res = @client.post("/noise_sensors/list", {connect_webview_id: connect_webview_id, connected_account_id: , connected_account_ids: , created_before: created_before, custom_metadata_has: , customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.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