Class: Seam::Clients::ThermostatsSimulate

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ ThermostatsSimulate

Returns a new instance of ThermostatsSimulate.



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

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

Instance Method Details

#hvac_mode_adjusted(device_id:, hvac_mode:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil) ⇒ nil

Simulates having adjusted the HVAC mode for a thermostat. Only applicable for sandbox devices. See also Testing Your Thermostat App with Simulate Endpoints.

Parameters:

  • device_id

    ID of the thermostat device for which you want to simulate having adjusted the HVAC mode.

  • hvac_mode

    HVAC mode that you want to simulate.

  • cooling_set_point_celsius (defaults to: nil)

    Cooling set point in °C that you want to simulate. You must set cooling_set_point_celsius or cooling_set_point_fahrenheit.

  • cooling_set_point_fahrenheit (defaults to: nil)

    Cooling set point in °F that you want to simulate. You must set cooling_set_point_fahrenheit or cooling_set_point_celsius.

  • heating_set_point_celsius (defaults to: nil)

    Heating set point in °C that you want to simulate. You must set heating_set_point_celsius or heating_set_point_fahrenheit.

  • heating_set_point_fahrenheit (defaults to: nil)

    Heating set point in °F that you want to simulate. You must set heating_set_point_fahrenheit or heating_set_point_celsius.

Returns:

  • (nil)

    OK



19
20
21
22
23
# File 'lib/seam/routes/thermostats_simulate.rb', line 19

def hvac_mode_adjusted(device_id:, hvac_mode:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil)
  @client.post("/thermostats/simulate/hvac_mode_adjusted", {device_id: device_id, hvac_mode: hvac_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact)

  nil
end

#temperature_reached(device_id:, temperature_celsius: nil, temperature_fahrenheit: nil) ⇒ nil

Simulates a thermostat reaching a specified temperature. Only applicable for sandbox devices. See also Testing Your Thermostat App with Simulate Endpoints.

Parameters:

  • device_id

    ID of the thermostat device that you want to simulate reaching a specified temperature.

  • temperature_celsius (defaults to: nil)

    Temperature in °C that you want simulate the thermostat reaching. You must set temperature_celsius or temperature_fahrenheit.

  • temperature_fahrenheit (defaults to: nil)

    Temperature in °F that you want simulate the thermostat reaching. You must set temperature_fahrenheit or temperature_celsius.

Returns:

  • (nil)

    OK



30
31
32
33
34
# File 'lib/seam/routes/thermostats_simulate.rb', line 30

def temperature_reached(device_id:, temperature_celsius: nil, temperature_fahrenheit: nil)
  @client.post("/thermostats/simulate/temperature_reached", {device_id: device_id, temperature_celsius: temperature_celsius, temperature_fahrenheit: temperature_fahrenheit}.compact)

  nil
end