class Fritzbox::Smarthome::SmokeDetector
Attributes
alert_state[RW]
last_alert[RW]
Public Class Methods
match?(data)
click to toggle source
# File lib/fritzbox/smarthome/smoke_detector.rb, line 10 def match?(data) data.key?('alert') end
new_from_api(data)
click to toggle source
Calls superclass method
Fritzbox::Smarthome::Actor::new_from_api
# File lib/fritzbox/smarthome/smoke_detector.rb, line 14 def new_from_api(data) instance = super instance.assign_attributes( alert_state: data.dig('alert', 'state').to_i, last_alert: Time.at(data.dig('alert', 'lastalertchgtimestamp').to_i) ) instance end