# frozen_string_literal: true module DjiMqttConnect module Thing::Product # { # "bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", # "tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx", # "data": { # "live_capacity": { # "available_video_number": 3, # "coexist_video_number_max": 2, # "device_list": [ # { # "sn": "4BKBJ4R1010TGD", # "available_video_number": 1, # "coexist_video_number_max": 1, # "camera_list": [ # { # "camera_index": "165-0-7", # "available_video_number": 1, # "coexist_video_number_max": 1, # "video_list": [ # { # "video_index": "normal-0", # "video_type": "normal", # "switchable_video_types": [ # "normal" # ] # } # ] # } # ] # }, # { # "sn": "1581F4BND22180040075", # "available_video_number": 2, # "coexist_video_number_max": 2, # "camera_list": [ # { # "camera_index": "39-0-7", # "available_video_number": 1, # "coexist_video_number_max": 1, # "video_list": [ # { # "video_index": "normal-0", # "video_type": "normal", # "switchable_video_types": [ # "normal" # ] # } # ] # }, # { # "camera_index": "52-0-0", # "available_video_number": 1, # "coexist_video_number_max": 1, # "video_list": [ # { # "video_index": "normal-0", # "video_type": "wide", # "switchable_video_types": [ # "wide", # "zoom", # "ir" # ] # } # ] # } # ] # } # ] # } # }, # "timestamp:": 1654070968655, # "gateway": "4BKBJ4R1010TGD" # } class StateMessage < DjiMqttConnect::Message attribute :tid, Types::UUID attribute :bid, Types::UUID attribute :timestamp, Types::Timestamp attribute :gateway, Types::String attribute :_data, Types::Hash attribute :data do # Not all messages will have a live_capacity attribute attribute? :live_capacity do attribute :available_video_number, Types::Integer attribute :coexist_video_number_max, Types::Integer attribute :device_list, Types::Array do attribute :sn, Types::String attribute :available_video_number, Types::Integer attribute :coexist_video_number_max, Types::Integer attribute :camera_list, Types::Array do attribute :camera_index, Types::String attribute :available_video_number, Types::Integer attribute :coexist_video_number_max, Types::Integer attribute :video_list, Types::Array do attribute :video_index, Types::String attribute :video_type, Types::String attribute :switchable_video_types, Types::Array.of(Types::String) end end end end end end end end