Class: Fritzbox::Smarthome::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/fritzbox/smarthome/resource.rb

Direct Known Subclasses

Actor

Class Method Summary collapse

Class Method Details

.get(command:, ain: nil, param: nil) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/fritzbox/smarthome/resource.rb', line 5

def get(command:, ain: nil, param: nil)
  url = "#{config.endpoint}/webservices/homeautoswitch.lua?switchcmd=#{command}&sid=#{authenticate}"
  url = "#{url}&ain=#{ain}"     if ain.present?
  url = "#{url}&param=#{param}" if param.present?

  HTTParty.get(url, **httparty_options)
end