Class: TeslaAPI::ClimateState
- Defined in:
- lib/tesla-api/climate_state.rb
Overview
Defines the climate state of the vehicle.
Instance Method Summary collapse
-
#auto_conditioning_on? ⇒ Boolean
If auto air conditioning is on.
-
#driver_temp_setting_celcius ⇒ Float
Temperature (celcius) the driver has set.
-
#fan_on? ⇒ Boolean
If the fan is on.
-
#fan_speed ⇒ Integer
0 to 6 (or nil).
-
#front_defroster_on? ⇒ Boolean
If the front defroster is on.
-
#initialize(data) ⇒ Boolean
constructor
If the fan is on.
-
#inside_temp_celcius ⇒ Float
Temperature (celcius) inside the vehicle.
-
#outside_temp_celcius ⇒ Float
Temperature (celcius) outside the vehicle.
-
#passenger_temp_setting_celcius ⇒ Float
Temperature (celcius) the passenger has set.
-
#rear_defroster_on? ⇒ Boolean
If the rear defroster is on.
Methods inherited from Data
#inspect, #ivar_from_data, #method_missing, #respond_to_missing?
Constructor Details
#initialize(data) ⇒ Boolean
Returns if the fan is on.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/tesla-api/climate_state.rb', line 41 def initialize(data) ivar_from_data("inside_temp_celcius", "inside_temp", data) ivar_from_data("outside_temp_celcius", "outside_temp", data) ivar_from_data("driver_temp_setting_celcius", "driver_temp_setting", data) ivar_from_data("passenger_temp_setting_celcius", "passenger_temp_setting", data) ivar_from_data("fan_speed", "fan_speed", data) @auto_conditioning_on = !!data["is_auto_conditioning_on"] @front_defroster_on = !!data["is_front_defroster_on"] @rear_defroster_on = !!data["is_rear_defroster_on"] @fan_on = !data["fan_status"].nil? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class TeslaAPI::Data
Instance Method Details
#auto_conditioning_on? ⇒ Boolean
Returns if auto air conditioning is on.
|
# File 'lib/tesla-api/climate_state.rb', line 25
|
#driver_temp_setting_celcius ⇒ Float
Returns Temperature (celcius) the driver has set.
|
# File 'lib/tesla-api/climate_state.rb', line 13
|
#fan_on? ⇒ Boolean
Returns if the fan is on.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/tesla-api/climate_state.rb', line 41 def initialize(data) ivar_from_data("inside_temp_celcius", "inside_temp", data) ivar_from_data("outside_temp_celcius", "outside_temp", data) ivar_from_data("driver_temp_setting_celcius", "driver_temp_setting", data) ivar_from_data("passenger_temp_setting_celcius", "passenger_temp_setting", data) ivar_from_data("fan_speed", "fan_speed", data) @auto_conditioning_on = !!data["is_auto_conditioning_on"] @front_defroster_on = !!data["is_front_defroster_on"] @rear_defroster_on = !!data["is_rear_defroster_on"] @fan_on = !data["fan_status"].nil? end |
#fan_speed ⇒ Integer
Returns 0 to 6 (or nil).
|
# File 'lib/tesla-api/climate_state.rb', line 21
|
#front_defroster_on? ⇒ Boolean
Returns if the front defroster is on.
|
# File 'lib/tesla-api/climate_state.rb', line 29
|
#inside_temp_celcius ⇒ Float
Returns Temperature (celcius) inside the vehicle.
|
# File 'lib/tesla-api/climate_state.rb', line 5
|
#outside_temp_celcius ⇒ Float
Returns Temperature (celcius) outside the vehicle.
|
# File 'lib/tesla-api/climate_state.rb', line 9
|
#passenger_temp_setting_celcius ⇒ Float
Returns Temperature (celcius) the passenger has set.
|
# File 'lib/tesla-api/climate_state.rb', line 17
|
#rear_defroster_on? ⇒ Boolean
Returns if the rear defroster is on.
|
# File 'lib/tesla-api/climate_state.rb', line 33
|