Skip to content

Commit

Permalink
Make new attributes available for HA (#517)
Browse files Browse the repository at this point in the history
Make the atrributes from #516 available for HA:

* charging target
* charging limit

also added:

* charging mode
* charging preference
* charging_start_time which is already part of sensor.py in HA but isn't available without this change
* is_pre_entry_climatization_enabled
  • Loading branch information
gerard33 authored Feb 12, 2023
1 parent 3633a5d commit 3e1bb9e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bimmer_connected/vehicle/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,19 @@ def drive_train_attributes(self) -> List[str]:
if self.has_electric_drivetrain:
result += [
"charging_time_remaining",
"charging_start_time",
"charging_end_time",
"charging_time_label",
"charging_status",
"connection_status",
"remaining_battery_percent",
"remaining_range_electric",
"last_charging_end_result",
"ac_current_limit",
"charging_target",
"charging_mode",
"charging_preferences",
"is_pre_entry_climatization_enabled",
]
if self.has_combustion_drivetrain:
result += ["remaining_fuel", "remaining_range_fuel", "remaining_fuel_percent"]
Expand Down
12 changes: 12 additions & 0 deletions test/test_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,19 @@ async def test_available_attributes(caplog):
"remaining_range_total",
"mileage",
"charging_time_remaining",
"charging_start_time",
"charging_end_time",
"charging_time_label",
"charging_status",
"connection_status",
"remaining_battery_percent",
"remaining_range_electric",
"last_charging_end_result",
"ac_current_limit",
"charging_target",
"charging_mode",
"charging_preferences",
"is_pre_entry_climatization_enabled",
"remaining_fuel",
"remaining_range_fuel",
"remaining_fuel_percent",
Expand All @@ -173,13 +179,19 @@ async def test_available_attributes(caplog):
"remaining_range_total",
"mileage",
"charging_time_remaining",
"charging_start_time",
"charging_end_time",
"charging_time_label",
"charging_status",
"connection_status",
"remaining_battery_percent",
"remaining_range_electric",
"last_charging_end_result",
"ac_current_limit",
"charging_target",
"charging_mode",
"charging_preferences",
"is_pre_entry_climatization_enabled",
"condition_based_services",
"check_control_messages",
"door_lock_state",
Expand Down

0 comments on commit 3e1bb9e

Please sign in to comment.