Class: TuyaCloud::Device::Control
- Inherits:
-
Object
- Object
- TuyaCloud::Device::Control
- Defined in:
- lib/tuya_cloud/device.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#auth_context ⇒ Object
Returns the value of attribute auth_context.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(json, auth_context) ⇒ Control
constructor
A new instance of Control.
- #process_request(name, payload: {}) ⇒ Object
Constructor Details
#initialize(json, auth_context) ⇒ Control
Returns a new instance of Control.
35 36 37 38 |
# File 'lib/tuya_cloud/device.rb', line 35 def initialize(json, auth_context) self.id = json['id'] self.auth_context = auth_context end |
Instance Attribute Details
#auth_context ⇒ Object
Returns the value of attribute auth_context.
32 33 34 |
# File 'lib/tuya_cloud/device.rb', line 32 def auth_context @auth_context end |
#id ⇒ Object
Returns the value of attribute id.
32 33 34 |
# File 'lib/tuya_cloud/device.rb', line 32 def id @id end |
Instance Method Details
#process_request(name, payload: {}) ⇒ Object
40 41 42 43 44 |
# File 'lib/tuya_cloud/device.rb', line 40 def process_request(name, payload: {}) auth_context.process_request(name, 'control', device_id: id, payload: payload) end |