stex v0.2.6 Stex.Devices View Source
SmartThings Devices API endpoint library
Link to this section Summary
Functions
Filter utility for finding devices with the specified capability
List all authorized devices
SmartThings built in endpoint for finding devices based on capability
Show device
Get the current status of a device component’s capability. If the token is for a SmartApp that created the device then it implicitly has permission for this api
Get the status of all attributes of a the component. The results may be filtered if the requester only has permission to view a subset of the component’s capabilities. If the token is for a SmartApp that created the device then it implicitly has permission for this api
Get the current status of all of a device’s component’s attributes. The results may be filtered if the requester only has permission to view a subset of the device’s components or capabilities. If the token is for a SmartApp that created the device then it implicitly has permission for this api
Link to this section Functions
Filter utility for finding devices with the specified capability.
## Examples
iex> client = Stex.connect(your_access_token)
iex> list = Stex.Devices.list(client)
iex> devices = Stex.Devices.filter_by_capability(list, "powerMeter")
List all authorized devices
Max: 200 by default will return up to 200 devices.
## Examples
iex> client = Stex.connect(your_access_token)
iex> Stex.Devices.list(client)
SmartThings built in endpoint for finding devices based on capability
Max: 200 by default will return up to 200 devices. Curently Broken!
Examples
iex> client = Stex.connect(your_access_token) iex> Stex.Devices.list_by_capability(client, “powerMeter”)
Show device
Examples
iex> client = Stex.connect(your_access_token)
iex> Stex.Devices.show(client, "some-device-id")
Get the current status of a device component’s capability. If the token is for a SmartApp that created the device then it implicitly has permission for this api.
## Examples
iex> client = Stex.connect(your_access_token)
iex> device = Stex.Devices.show(client, "some-device-id")
iex> component_status = device |> show_capability_status("main", "powerMeter")
Get the status of all attributes of a the component. The results may be filtered if the requester only has permission to view a subset of the component’s capabilities. If the token is for a SmartApp that created the device then it implicitly has permission for this api.
This function is chainable
## Examples
iex> client = Stex.connect(your_access_token)
iex> device = Stex.Devices.show(client, "some-device-id")
iex> component_status = device |> show_component_status("main")
Get the current status of all of a device’s component’s attributes. The results may be filtered if the requester only has permission to view a subset of the device’s components or capabilities. If the token is for a SmartApp that created the device then it implicitly has permission for this api.
This function is chainable
## Examples
iex> client = Stex.connect(your_access_token)
iex> device = Stex.Devices.show(some_device_id)
iex> status = device |> show_status