Repository: bimmerconnected/bimmer_connected
Pull request #247 (2020-11-12 12:32:07)

Typo
<!--
  Thanks for your contribution to bimmer_connected!
-->
## Breaking change
<!--
  If your PR contains a breaking change, please explain that change here.
  Note: Remove this section if this PR is NOT a breaking change.
-->


## Proposed change
<!--
  Describe the big picture of your changes here to communicate to the
  maintainers why we should accept this pull request. If it fixes a bug
  or resolves a feature request, be sure to link to that issue in the
  additional information section.
-->


## Type of change
- [X] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (which adds functionality to this library)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [X] Code quality improvements to existing code or addition of tests

## Additional information
<!--
  Details are important, and help maintainers processing your PR.
  Please be sure to fill out additional details, if applicable.
-->

- This PR fixes or closes issue: fixes #
- This PR is related to issue: 

## Checklist
<!--
  Put an `x` in the boxes that apply. You can also fill these out after
  creating the PR. If you're unsure about any of them, don't hesitate to ask.
  We're here to help! This is simply a reminder of what we are going to look
  for before merging your code.
-->

- [X] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works.



Patch:
diff --git a/bimmer_connected/all_trips.py b/bimmer_connected/all_trips.py
index 10fded9..522e233 100644
--- a/bimmer_connected/all_trips.py
+++ b/bimmer_connected/all_trips.py
@@ -139,8 +139,8 @@ class AllTrips:  # pylint: disable=too-many-public-methods
 
     @property
     @backend_parameter
-    def average_recopuration(self) -> StatisticValues:
-        """Returns the average recopuration."""
+    def average_recuperation(self) -> StatisticValues:
+        """Returns the average recuperation."""
         return StatisticValues(self._state.attributes[SERVICE_ALL_TRIPS]['avgRecuperation'])
 
     @property
diff --git a/bimmer_connected/charging_profile.py b/bimmer_connected/charging_profile.py
index e3dcbaf..a2455dc 100644
--- a/bimmer_connected/charging_profile.py
+++ b/bimmer_connected/charging_profile.py
@@ -129,8 +129,8 @@ class ChargingProfile:  # pylint: disable=too-many-public-methods
 
     @property
     @backend_parameter
-    def prefered_charging_window(self) -> ChargingWindow:
-        """Returns the prefered charging window."""
+    def preferred_charging_window(self) -> ChargingWindow:
+        """Returns the preferred charging window."""
         return ChargingWindow(self._state.attributes[SERVICE_CHARGING_PROFILE]['preferredChargingWindow'])
 
     @property


Test patch:
diff --git a/test/test_all_trips.py b/test/test_all_trips.py
index ff0f7d6..c784c5a 100644
--- a/test/test_all_trips.py
+++ b/test/test_all_trips.py
@@ -30,10 +30,10 @@ class TestState(unittest.TestCase):
         self.assertEqual(35.53, state.all_trips.average_electric_consumption.community_high)
         self.assertEqual(14.76, state.all_trips.average_electric_consumption.user_average)
 
-        self.assertEqual(0, state.all_trips.average_recopuration.community_low)
-        self.assertEqual(3.76, state.all_trips.average_recopuration.community_average)
-        self.assertEqual(14.03, state.all_trips.average_recopuration.community_high)
-        self.assertEqual(2.3, state.all_trips.average_recopuration.user_average)
+        self.assertEqual(0, state.all_trips.average_recuperation.community_low)
+        self.assertEqual(3.76, state.all_trips.average_recuperation.community_average)
+        self.assertEqual(14.03, state.all_trips.average_recuperation.community_high)
+        self.assertEqual(2.3, state.all_trips.average_recuperation.user_average)
 
         self.assertEqual(121.58, state.all_trips.chargecycle_range.community_average)
         self.assertEqual(200, state.all_trips.chargecycle_range.community_high)
diff --git a/test/test_charging_profile.py b/test/test_charging_profile.py
index 5f9dc20..17790fe 100644
--- a/test/test_charging_profile.py
+++ b/test/test_charging_profile.py
@@ -29,5 +29,5 @@ class TestState(unittest.TestCase):
                          state.charging_profile.pre_entry_climatization_timer[TimerTypes.TIMER_1].departure_time)
         self.assertEqual('MONDAY', state.charging_profile.pre_entry_climatization_timer[TimerTypes.TIMER_1].weekdays[0])
 
-        self.assertEqual('05:02', state.charging_profile.prefered_charging_window.start_time)
-        self.assertEqual('17:31', state.charging_profile.prefered_charging_window.end_time)
+        self.assertEqual('05:02', state.charging_profile.preferred_charging_window.start_time)
+        self.assertEqual('17:31', state.charging_profile.preferred_charging_window.end_time)