Module: Sense::Expansions

Included in:
Client
Defined in:
lib/hello_sense/expansions.rb

Instance Method Summary collapse

Instance Method Details

#expansion(expansion_id) ⇒ Object



37
38
39
# File 'lib/hello_sense/expansions.rb', line 37

def expansion(expansion_id)
  get("/v2/expansions/#{expansion_id}")
end

#expansion_configurations(expansion_id) ⇒ Object



45
46
47
# File 'lib/hello_sense/expansions.rb', line 45

def expansion_configurations(expansion_id)
  get("/v2/expansions/#{expansion_id}/configurations")
end

#expansionsArray<Hash>

Examples:

[
  {
    "id" => 1,
    "service_name" => "NEST",
    "device_name" => "Nest Thermostat",
    "company_name" => "Nest",
    "description" => "Connecting Sense to your Nest Learning Thermostat allows you to control your thermostat with Voice, or automatically set a specific temperature ahead of your Sense alarm, so you wake up to your ideal temperature every morning.",
    "icon" => {
      "phone_1x" => "https://hello-data.s3.amazonaws.com/expansions/[email protected]",
      "phone_2x" => "https://hello-data.s3.amazonaws.com/expansions/[email protected]",
      "phone_3x" => "https://hello-data.s3.amazonaws.com/expansions/[email protected]"
    },
    "auth_uri" => "https://api.hello.is/v2/expansions/1/auth",
    "token_uri" => nil,
    "refresh_uri" => nil,
    "category" => "TEMPERATURE",
    "created" => 1495381368634,
    "completion_uri" => "https://api.hello.is/v2/expansions/redirect",
    "state" => "NOT_CONNECTED",
    "value_range" => {
      "min" => 9,
      "max" => 32
    }
  }
]


33
34
35
# File 'lib/hello_sense/expansions.rb', line 33

def expansions
  get('/v2/expansions')
end

#update_expansion(expansion_id, data) ⇒ Object



41
42
43
# File 'lib/hello_sense/expansions.rb', line 41

def update_expansion(expansion_id, data)
  patch("/v2/expansions/#{expansion_id}", data)
end

#update_expansion_configurations(expansion_id, data) ⇒ Object



49
50
51
# File 'lib/hello_sense/expansions.rb', line 49

def update_expansion_configurations(expansion_id, data)
  patch("/v2/expansions/#{expansion_id}/configurations", data)
end