Module: TpLinkSmartplug
- Defined in:
- lib/tp_link_smartplug.rb,
lib/tp_link_smartplug/_base.rb,
lib/tp_link_smartplug/device.rb,
lib/tp_link_smartplug/command.rb,
lib/tp_link_smartplug/helpers.rb,
lib/tp_link_smartplug/message.rb,
lib/tp_link_smartplug/version.rb
Overview
Defined Under Namespace
Modules: Command, Helpers, Message Classes: Base, BaseError, Device, DeviceError
Constant Summary collapse
- VERSION =
Gem version
'0.4.0'.freeze
Instance Method Summary collapse
-
#alias=(name) ⇒ Hash
Set plug alias.
-
#location!(longitude, lattitude) ⇒ Hash
Set plug location.
Instance Method Details
#alias=(name) ⇒ Hash
Set plug alias
210 211 212 |
# File 'lib/tp_link_smartplug/device.rb', line 210 def alias=(name) JSON.parse(poll(command: "{\"system\":{\"set_dev_alias\":{\"alias\":\"#{name}\"}}}")) end |
#location!(longitude, lattitude) ⇒ Hash
Set plug location
219 220 221 |
# File 'lib/tp_link_smartplug/device.rb', line 219 def location!(longitude, lattitude) JSON.parse(poll(command: "{\"system\":{\"set_dev_location\":{\"longitude\":\"#{lattitude}\", \"latitude\":\"#{longitude}\"}}}")) end |