Class: Google::Apis::HomegraphV1::Device

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/homegraph_v1/classes.rb,
generated/google/apis/homegraph_v1/representations.rb,
generated/google/apis/homegraph_v1/representations.rb

Overview

Third-party partner's device definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Device

Returns a new instance of Device



137
138
139
# File 'generated/google/apis/homegraph_v1/classes.rb', line 137

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#attributesHash<String,Object>

Attributes for the traits supported by the device. Corresponds to the JSON property attributes

Returns:

  • (Hash<String,Object>)


76
77
78
# File 'generated/google/apis/homegraph_v1/classes.rb', line 76

def attributes
  @attributes
end

#custom_dataString

Custom JSON data provided by the manufacturer and attached to QUERY and EXECUTE requests in AoG. Corresponds to the JSON property customData

Returns:

  • (String)


82
83
84
# File 'generated/google/apis/homegraph_v1/classes.rb', line 82

def custom_data
  @custom_data
end

#device_infoGoogle::Apis::HomegraphV1::DeviceInfo

Device information. Corresponds to the JSON property deviceInfo



87
88
89
# File 'generated/google/apis/homegraph_v1/classes.rb', line 87

def device_info
  @device_info
end

#idString

Third-party partner's device ID. Corresponds to the JSON property id

Returns:

  • (String)


92
93
94
# File 'generated/google/apis/homegraph_v1/classes.rb', line 92

def id
  @id
end

#nameGoogle::Apis::HomegraphV1::DeviceNames

Different names for the device. Corresponds to the JSON property name



97
98
99
# File 'generated/google/apis/homegraph_v1/classes.rb', line 97

def name
  @name
end

#other_device_idsArray<Google::Apis::HomegraphV1::AgentOtherDeviceId>

IDs of other devices associated with this device. This is used to represent a device group (e.g. bonded zone) or "facets" synced through different flows (e.g. Google Nest Hub Max with a Nest Camera). This may also be used to pass in alternate IDs used to identify a cloud synced device for local execution (i.e. local verification). If used for local verification, this field is synced from the cloud. Corresponds to the JSON property otherDeviceIds



107
108
109
# File 'generated/google/apis/homegraph_v1/classes.rb', line 107

def other_device_ids
  @other_device_ids
end

#room_hintString

If the third-party partner's cloud configuration includes placing devices in rooms, the name of the room can be provided here. Corresponds to the JSON property roomHint

Returns:

  • (String)


113
114
115
# File 'generated/google/apis/homegraph_v1/classes.rb', line 113

def room_hint
  @room_hint
end

#structure_hintString

As in roomHint, for structures that users set up in the partner's system. Corresponds to the JSON property structureHint

Returns:

  • (String)


118
119
120
# File 'generated/google/apis/homegraph_v1/classes.rb', line 118

def structure_hint
  @structure_hint
end

#traitsArray<String>

Traits supported by the device. Corresponds to the JSON property traits

Returns:

  • (Array<String>)


123
124
125
# File 'generated/google/apis/homegraph_v1/classes.rb', line 123

def traits
  @traits
end

#typeString

Hardware type of the device (e.g. light, outlet, etc). Corresponds to the JSON property type

Returns:

  • (String)


128
129
130
# File 'generated/google/apis/homegraph_v1/classes.rb', line 128

def type
  @type
end

#will_report_stateBoolean Also known as: will_report_state?

Indicates whether the state of this device is being reported to Google through ReportStateAndNotification call. Corresponds to the JSON property willReportState

Returns:

  • (Boolean)


134
135
136
# File 'generated/google/apis/homegraph_v1/classes.rb', line 134

def will_report_state
  @will_report_state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'generated/google/apis/homegraph_v1/classes.rb', line 142

def update!(**args)
  @attributes = args[:attributes] if args.key?(:attributes)
  @custom_data = args[:custom_data] if args.key?(:custom_data)
  @device_info = args[:device_info] if args.key?(:device_info)
  @id = args[:id] if args.key?(:id)
  @name = args[:name] if args.key?(:name)
  @other_device_ids = args[:other_device_ids] if args.key?(:other_device_ids)
  @room_hint = args[:room_hint] if args.key?(:room_hint)
  @structure_hint = args[:structure_hint] if args.key?(:structure_hint)
  @traits = args[:traits] if args.key?(:traits)
  @type = args[:type] if args.key?(:type)
  @will_report_state = args[:will_report_state] if args.key?(:will_report_state)
end