Commit Graph

43 Commits (b07e9df308a2fec26d76ee0ae046c5699d0546d1)

Author SHA1 Message Date
Joost Lekkerkerker a8887d59ed
Add icon translations to BMW (#111348)
* Add icon translations to BMW

* Add icon translations to BMW
2024-02-28 13:05:27 +01:00
J. Nick Koston d5e1934942
Use an eager task in the update coordinator scheduled refresh (#111570)
* Use an eager task in the update coordinator scheduled refresh

We have a lot of places that will not suspend because the refresh function
decides it does not need to update. Currently these have to be scheduled
on the event loop even though they are a noop.

Since _handle_refresh_interval is subclassed in some integrations, I created
a dunder wrapper function to avoid integraions subclassing it

* fix time fires outside of patch
2024-02-26 23:31:08 -05:00
Richard Kroegel 1b8bda6067
Remove old BMW vehicles/devices automatically (#110255)
* Remove not assigned vehicles from DeviceRegistry on startup

* Replace async_remove_device with async_update_device

* Add test

* Use generator

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-12 10:52:08 +01:00
Jan Bouwhuis c7eab49c70
Raise ServiceValidationError on invalid select option (#106350)
* Raise ServiceValidationError on invalid select option

* Fix tests

* Correct place holders

* More test fixes
2023-12-27 09:45:55 +01:00
Richard Kroegel 2287c45afc
Bump bimmer-connected to 0.14.5 (#104715)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-11-29 18:11:04 +01:00
Jan-Philipp Benecke 9ab1cb83d8
Update a-c* tests to use entity & device registry fixtures (#103793)
* Update a-c* tests to use entity & device registry fixtures

* Revert some changes

* Revert formatting

* retrigger CI
2023-11-12 13:45:30 -05:00
Richard Kroegel f61627ea08
Bump bimmer_connected to 0.14.1 (#101789)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-10-11 13:46:02 +02:00
Richard Kroegel bec36d3914
Add long-term statistics to BMW sensors (#99506)
* Add long-term statistics to BMW ConnectedDrive sensors

* Add sensor test snapshot

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-09-02 14:44:28 -07:00
Richard Kroegel 021b14fc17
Refactor & enhance BMW tests (#97895)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-08-30 11:45:09 +02:00
Richard Kroegel b403cb41c0
Allow one retry before raising ConfigEntryAuthFailed for bmw_connected_drive (#99168)
* Allow one retry before raising ConfigEntryAuthFailed

* Move time with freezer

* Update homeassistant/components/bmw_connected_drive/coordinator.py

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-08-29 21:41:50 +02:00
Richard Kroegel 74d02a1574
BMW: Remove deprecated refresh from cloud button (#97864)
* Remove deprecated refresh from cloud button

* Clean up strings.json
2023-08-05 22:28:24 +02:00
Richard Kroegel f1a54a510c
Re-add "deactivate air conditioning" button to bmw_connected_drive (#94765) 2023-06-27 19:55:46 +02:00
Richard Kroegel 410b15df92
Improve exception handling for BMW remote services (#92199)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-06-26 19:05:50 +02:00
rikroe 1ea202a5bc
Add charging switch to BMW Connected Drive (#93737)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-29 23:48:13 +02:00
rikroe 52ef4a3b75
Ensure state update after BMW remote service execution (#93745)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-29 23:28:06 +02:00
rikroe f8f83906f8
Add climate on/off for supported BMW vehicles (#92962)
* Add switch platform

* Add tests

* Remove separate button

* Bump coverage

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-23 15:21:29 +02:00
rikroe defc23cc7c
Fix china login for bmw_connected_drive (#93180)
* Bump bimmer_connected to 0.13.5

* Fix snapshots after dependency bump

* Load gcid from config entry if available

* Add tests

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-17 02:03:01 +02:00
rikroe 9a65a89aa4
Improve internet/API error handling for BMW (#90274)
* Improve internet/API error handling

* Switch to library exceptions for HTTP status errors

* Remove duplicate logging after reconnect

* Raise UpdateFailed instead of custom log handling

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-05-06 10:00:37 +02:00
rikroe 1028841690
Move BMW Target SoC to number platform (#91081)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-04-29 17:41:34 +02:00
rikroe 565f311f5c
Add EV charging remote services for BMW/Mini (#88759)
* Add select for EV charging to bmw_connected_drive

* Use snapshot for select tests, split select_option tests

* Apply suggestions from code review

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Further adjustments from code review

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-30 19:37:03 +02:00
rikroe bec7bbeb92
Use SnapshotAssertion in bmw_connected_drive tests (#90128) 2023-03-26 16:57:19 +02:00
rikroe cc337c4ff6
Add Re-Auth to bmw_connected_drive (#90251)
* Add Re-Auth to bmw_connected_drive

* Always store refresh token to entry

* Fix tests

* Typo

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-03-25 10:09:33 -07:00
rikroe 1a2fa51ac9
Bump bimmer_connected to 0.13.0 (#90127) 2023-03-23 10:01:01 +01:00
J. Nick Koston 99b58f157e
Bump PyJWT to 2.6.0 (#90134)
* Bump PyJWT to 2.6.0

* fix time being frozen too late which makes the access token creation time in the future

* revert zha change

* fix repairs test

* fix ical test
2023-03-22 20:00:47 -04:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet 0cf5e9fb4a
Add type hints to integration tests (part 2) (#87789)
* Add type hints to integration tests (part 2)

* typo

* Improve analytics

* Improve automation

* Imrpove bluetooth
2023-02-10 16:05:26 +01:00
epenet 807c69f621
Add type hints to integration tests (b-c) (#87698) 2023-02-08 18:08:43 +01:00
rikroe 1afb30344a
Add diagnostics to bmw_connected_drive (#74871)
* Add diagnostics to bmw_connected_drive

* Add tests for diagnostics

* Move get_fingerprints to library, bump bimmer_connected to 0.10.4

* Update bimmer_connected to 0.11.0

* Fix pytest

* Mock actual diagnostics HTTP calls

* Update tests for bimmer_connected 0.12.0

* Don't raise errors if vehicle is not found

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-01-11 01:09:45 +01:00
rikroe 5b8b6167ac
Bump bimmer_connected to 0.12.0 (#85255)
* Bump bimmer_connected to 0.12.0

* Fix mypy

* Remove not needed code

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-01-06 03:05:37 +01:00
epenet e84e5f134e
Use US_CUSTOMARY_SYSTEM in tests (#80658)
* Use US_CUSTOMARY_SYSTEM in tests

* Don't update test_unit_system
2022-10-20 15:42:23 +02:00
epenet 9490771a87
Refactor distance, speed and volume utils (#77952)
* Refactor distance util

* Fix bmw connected drive tests

* Adjust here travel time tests

* Adjust waze travel time tests

* Adjust test_distance

* Adjust rounding values

* Adjust more tests

* Adjust volume conversions

* Add tests
2022-09-07 16:18:00 +02:00
rikroe cb2799bc37
Fix displayed units for BMW Connected Drive (#76613)
* Fix displayed units

* Add tests for unit conversion

* Streamline test config entry init

* Refactor test to pytest fixture

* Fix renamed mock

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2022-08-16 21:36:33 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
rikroe 54591b8ca1
BMW Connected Drive: Handle HTTP 429 issues better (#73675)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2022-06-22 14:24:16 +02:00
rikroe cd769a55c2
Update BMW connected drive to async (#71827)
* Change BMW connected drive to async

* Fix coordinator exceptions, fix tests

* Fix using deprecated property

* Write HA state directly

* Remove code that cannnot throw Exceptions from try/except

* Use public async_write_ha_state

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix login using refresh_token if token expired

* MyPy fixes

* Fix pytest, bump dependency

* Replace OptionFlow listener with explicit refresh

* Remove uneeded async_get_entry

* Update test to include change on OptionsFlow

* Bump bimmer_connected to 0.9.0

* Migrate renamed entitity unique_ids

* Don't replace async_migrate_entries, add tests

* Rename existing_entry to existing_entry_id

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests

* Import full EntityRegistry

* Fix comment

* Increase timeout to 60s

* Rely on library timeout

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-24 21:44:18 +02:00
rikroe a12870081e
Remove deprecated yaml config from bmw_connected_drive (#66965)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2022-02-24 13:04:21 +01:00
rikroe 380c1a4be9
Fix BMW Connected Drive (#60938)
* Bump bimmer_connected to 0.8.5

* Always update HA states after service execution

* Fix BMW device tracker & vehicle_finder service

* Add charging_end_time sensor

* Fix pylint & pytest

* Remove unneeded DEFAULT_OPTION

* Revert adding charging_end_time & state_attributes

* Don't delete option data for CONF_USE_LOCATION

* Remove stale string

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2021-12-05 11:20:40 +01:00
Paulus Schoutsen ee2c950716
Merge system options into pref properties (#51347)
* Make system options future proof

* Update tests

* Add types
2021-06-01 22:34:31 +02:00
Franck Nijhof c68b259bd3
Cleanup of unused connection_class logic (#49865)
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
tkdrob 9a570d7c32
Use core constants for bmw_connected_drive (#46042) 2021-02-05 08:02:28 -05:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
rikroe e5f31665b1
Add Config Flow to bmw_connected_drive (#39585)
* Add Config Flow to bmw_connected_drive

* Fix checks for bmw_connected_drive

* Adjust code as requested

* Clean .coveragerc after merge

* Use references for config flow

* Fix execute_service check against allowed accounts

* Adjust translation as username can be email or phone no

* Add BMWConnectedDriveBaseEntity mixin, remove unnecessary type casts

* Use BaseEntity correctly, fix pylint error

* Bump bimmer_connected to 0.7.13

* Adjustments for review

* Fix pylint

* Fix loading notify, move vin to entity attrs

* Remove vin from device registry

* Remove commented-out code

* Show tracker warning only if vehicle (currently) doesn't support location

* Remove unnecessary return values & other small adjustments

* Move original hass_config to own domain in hass.data

* Move entries to separate dict in hass.data

* Remove invalid_auth exception handling & test as it cannot happen

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2020-12-29 11:06:12 +01:00