Class: SDN::Message::ILT2::SetMotorSettings
- Inherits:
-
UnknownMessage
- Object
- SDN::Message
- UnknownMessage
- SDN::Message::ILT2::SetMotorSettings
- Defined in:
- lib/sdn/message/ilt2/set.rb
Overview
the motor does not move, and just stores the new values flags of 1 is reverse direction, but you have to set it every time
Constant Summary collapse
- MSG =
0x52
- PARAMS_LENGTH =
5
Instance Attribute Summary collapse
-
#down_limit ⇒ Object
Returns the value of attribute down_limit.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#position_pulses ⇒ Object
Returns the value of attribute position_pulses.
Attributes inherited from UnknownMessage
Attributes inherited from SDN::Message
#ack_requested, #dest, #node_type, #src
Instance Method Summary collapse
-
#initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) ⇒ SetMotorSettings
constructor
A new instance of SetMotorSettings.
- #params ⇒ Object
- #parse(params) ⇒ Object
Methods inherited from UnknownMessage
Methods inherited from SDN::Message
#==, #class_inspect, expected_response?, inherited, #inspect, parse, #serialize
Methods included from Helpers
#checksum, #from_number, #from_string, #group_address?, #node_type_from_number, #node_type_to_number, #node_type_to_string, #parse_address, #print_address, #to_number, #to_string, #transform_param
Constructor Details
#initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) ⇒ SetMotorSettings
Returns a new instance of SetMotorSettings.
176 177 178 179 180 181 182 |
# File 'lib/sdn/message/ilt2/set.rb', line 176 def initialize(dest = nil, flags = 0, down_limit = 0, position_pulses = 0, **kwargs) kwargs[:dest] ||= dest super(**kwargs) self.flags = flags self.down_limit = down_limit self.position_pulses = position_pulses end |
Instance Attribute Details
#down_limit ⇒ Object
Returns the value of attribute down_limit.
174 175 176 |
# File 'lib/sdn/message/ilt2/set.rb', line 174 def down_limit @down_limit end |
#flags ⇒ Object
Returns the value of attribute flags.
174 175 176 |
# File 'lib/sdn/message/ilt2/set.rb', line 174 def flags @flags end |
#position_pulses ⇒ Object
Returns the value of attribute position_pulses.
174 175 176 |
# File 'lib/sdn/message/ilt2/set.rb', line 174 def position_pulses @position_pulses end |
Instance Method Details
#params ⇒ Object
191 192 193 |
# File 'lib/sdn/message/ilt2/set.rb', line 191 def params transform_param(flags) + from_number(down_limit, 2) + from_number(position_pulses, 2) end |
#parse(params) ⇒ Object
184 185 186 187 188 189 |
# File 'lib/sdn/message/ilt2/set.rb', line 184 def parse(params) super self.flags = to_number(params[0]) self.down_limit = to_number(params[1..2]) self.position_pulses = to_number(params[3..4]) end |