Module: Fritzbox::Smarthome::Properties::SimpleOnOff::ClassMethods

Defined in:
lib/fritzbox/smarthome/properties/simple_on_off.rb

Instance Method Summary collapse

Instance Method Details

#new_from_api(data) ⇒ Object



16
17
18
19
20
# File 'lib/fritzbox/smarthome/properties/simple_on_off.rb', line 16

def new_from_api(data)
  instance = defined?(super) ? super : new
  instance.simpleonoff_state = data.dig('simpleonoff', 'state')
  instance
end