Class: DjiMqttConnect::Thing::Product::AlarmStateSwitchServicesMessage

Inherits:
ServicesMessage show all
Defined in:
lib/dji_mqtt_connect/messages/thing/product/services/alarm_state_switch.rb

Constant Summary collapse

ACTION_OPEN =
1
ACTION_CLOSE =
0

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ServicesMessage

#flight_ids, #humanized_summary

Methods inherited from Message

current_timestamp, generate_bid, generate_tid, #to_s

Class Method Details

.build(action:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dji_mqtt_connect/messages/thing/product/services/alarm_state_switch.rb', line 9

def self.build(action:, bid: generate_bid, tid: generate_tid, timestamp: current_timestamp)
  new(
    bid: bid,
    tid: tid,
    timestamp: timestamp,
    _method: "alarm_state_switch",
    data: {
      action: action
    }
  )
end

Instance Method Details

#humanized_summary_interpolationObject



32
33
34
35
36
# File 'lib/dji_mqtt_connect/messages/thing/product/services/alarm_state_switch.rb', line 32

def humanized_summary_interpolation
  super.merge(
    action: data.humanized_action
  )
end