Module: NatureRemo::Endpoints::Devices

Included in:
NatureRemo::Endpoints
Defined in:
lib/nature_remo/endpoints/devices.rb

Overview

Endpoints for Nature Remo devices

Instance Method Summary collapse

Instance Method Details

#delete_device(device_id:) ⇒ String

Parameters:

  • device_id (String)

    Remo id.

Returns:

  • (String)

    Deleted Remo.

Raises:



33
34
35
# File 'lib/nature_remo/endpoints/devices.rb', line 33

def delete_device(device_id:)
  post("devices/#{device_id}/delete")
end

#devicesString

Fetch the list of Remo devices the user has access to. swagger.nature.global/#/default/get_1_devices

Returns:

  • (String)

    The list of Remo devices.

Raises:



12
13
14
# File 'lib/nature_remo/endpoints/devices.rb', line 12

def devices
  get('devices')
end

#update_device(device_id:, name:) ⇒ String

Parameters:

  • device_id (String)

    Remo id.

  • name (String)

    New Remo name.

Returns:

  • (String)

Raises:



23
24
25
# File 'lib/nature_remo/endpoints/devices.rb', line 23

def update_device(device_id:, name:)
  post("devices/#{device_id}", { name: name })
end

#update_device_humidity_offset(device_id:, offset:) ⇒ String

Update humidity offset. swagger.nature.global/#/default/post_1_devices__device__humidity_offset

Parameters:

  • device_id (String)

    Remo id.

  • offset (String)

    Humidity offset value added to the measured humidity.

Returns:

  • (String)

    Updated

Raises:



55
56
57
# File 'lib/nature_remo/endpoints/devices.rb', line 55

def update_device_humidity_offset(device_id:, offset:)
  post("devices/#{device_id}/humidity_offset", { offset: offset })
end

#update_device_temperature_offset(device_id:, offset:) ⇒ String

Update temperature offset. swagger.nature.global/#/default/post_1_devices__device__temperature_offset

Parameters:

  • device_id (String)

    Remo id.

  • offset (String)

    Temperature offset value added to the measured temperature.

Returns:

  • (String)

    Updated

Raises:



44
45
46
# File 'lib/nature_remo/endpoints/devices.rb', line 44

def update_device_temperature_offset(device_id:, offset:)
  post("devices/#{device_id}/temperature_offset", { offset: offset })
end