|
1 | 1 | module TeslaAPI
|
| 2 | + |
| 3 | + # Defines the current charge state of the vehicle |
2 | 4 | class ChargeState < Data
|
3 |
| - def initialize(data) |
| 5 | + ## |
| 6 | + # :method: charging_state |
| 7 | + # Charging state ("Complete", "Charging") |
| 8 | + |
| 9 | + ## |
| 10 | + # :method charging_to_max? |
| 11 | + # true if currently performing a range charge |
| 12 | + |
| 13 | + ## |
| 14 | + # :method: battery_range_miles |
| 15 | + # Rated miles for the current charge |
| 16 | + |
| 17 | + ## |
| 18 | + # :method: estimated_battry_range_miles |
| 19 | + # Range estimated from current driving |
| 20 | + |
| 21 | + ## |
| 22 | + # :method: ideal_battery_range_miles |
| 23 | + # Ideal range for the current charge |
| 24 | + |
| 25 | + ## |
| 26 | + # :method: battery_percentage |
| 27 | + # Percentage of battery charge |
| 28 | + |
| 29 | + ## |
| 30 | + # :method: battery_current_flow |
| 31 | + # Current flowing into the battery |
| 32 | + |
| 33 | + ## |
| 34 | + # :method: charger_voltage |
| 35 | + # Current voltage being used to charge battery |
| 36 | + |
| 37 | + ## |
| 38 | + # :method: charger_pilot_amperage |
| 39 | + # Max amperage allowed by the charger |
| 40 | + |
| 41 | + ## |
| 42 | + # :method: charger_actual_amperage |
| 43 | + # Current amperage being drawn into battery |
| 44 | + |
| 45 | + ## |
| 46 | + # :method: charger_power |
| 47 | + # Kilowatt of charger (rounded down) |
| 48 | + |
| 49 | + ## |
| 50 | + # :method: hours_to_full_charge |
| 51 | + # Hours remaining until the vehicle is fully charged |
| 52 | + |
| 53 | + ## |
| 54 | + # :method: charge_rate_miles_per_hour |
| 55 | + # Miles of range being added per hour |
| 56 | + |
| 57 | + ## |
| 58 | + # :method: charge_port_open? |
| 59 | + # true if the charge port is open |
| 60 | + |
| 61 | + ## |
| 62 | + # :method: supercharging? |
| 63 | + # true if charging via a Tesla SuperCharger |
| 64 | + |
| 65 | + def initialize(data) # :nodoc: |
4 | 66 | ivar_from_data("charging_state", "charging_state", data)
|
5 | 67 | ivar_from_data("charging_to_max", "charge_to_max_range", data)
|
6 | 68 | ivar_from_data("battery_range_miles", "battery_range", data)
|
|
0 commit comments