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.



150
151
152
# File 'generated/google/apis/homegraph_v1/classes.rb', line 150

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_dataHash<String,Object>

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

Returns:

  • (Hash<String,Object>)


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

#notification_supported_by_agentBoolean Also known as: notification_supported_by_agent?

Indicates whether the device is capable of sending notifications. This field will be set by the agent (partner) on an incoming SYNC. If a device is not capable of generating notifications, the partner should set this flag to false. If a partner is not capable of calling ReportStateAndNotification to send notifications to Google, the partner should set this flag to false. If there is a user setting in the partner app to enable notifications and it is turned off, the partner should set this flag to false. Corresponds to the JSON property notificationSupportedByAgent

Returns:

  • (Boolean)


109
110
111
# File 'generated/google/apis/homegraph_v1/classes.rb', line 109

def notification_supported_by_agent
  @notification_supported_by_agent
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



120
121
122
# File 'generated/google/apis/homegraph_v1/classes.rb', line 120

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)


126
127
128
# File 'generated/google/apis/homegraph_v1/classes.rb', line 126

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)


131
132
133
# File 'generated/google/apis/homegraph_v1/classes.rb', line 131

def structure_hint
  @structure_hint
end

#traitsArray<String>

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

Returns:

  • (Array<String>)


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

def traits
  @traits
end

#typeString

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

Returns:

  • (String)


141
142
143
# File 'generated/google/apis/homegraph_v1/classes.rb', line 141

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)


147
148
149
# File 'generated/google/apis/homegraph_v1/classes.rb', line 147

def will_report_state
  @will_report_state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'generated/google/apis/homegraph_v1/classes.rb', line 155

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)
  @notification_supported_by_agent = args[:notification_supported_by_agent] if args.key?(:notification_supported_by_agent)
  @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