Class: Sappho::Heatmiser::Proxy::HeatmiserStatus::TimedTemperature
- Inherits:
-
Object
- Object
- Sappho::Heatmiser::Proxy::HeatmiserStatus::TimedTemperature
- Defined in:
- lib/sappho-heatmiser-proxy/heatmiser_status.rb
Instance Attribute Summary collapse
-
#hour ⇒ Object
readonly
Returns the value of attribute hour.
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(raw, bytePosition) ⇒ TimedTemperature
constructor
A new instance of TimedTemperature.
- #valid? ⇒ Boolean
Constructor Details
#initialize(raw, bytePosition) ⇒ TimedTemperature
Returns a new instance of TimedTemperature.
26 27 28 29 30 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 26 def initialize raw, bytePosition @hour = raw[bytePosition] & 0xFF @minute = raw[bytePosition + 1] & 0xFF @temperature = raw[bytePosition + 2] & 0xFF end |
Instance Attribute Details
#hour ⇒ Object (readonly)
Returns the value of attribute hour.
24 25 26 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 24 def hour @hour end |
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
24 25 26 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 24 def minute @minute end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
24 25 26 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 24 def temperature @temperature end |
Instance Method Details
#description ⇒ Object
36 37 38 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 36 def description "#{@hour}:#{@minute}-#{@temperature}" end |
#valid? ⇒ Boolean
32 33 34 |
# File 'lib/sappho-heatmiser-proxy/heatmiser_status.rb', line 32 def valid? @hour < 24 and @minute < 60 end |