Skip to content

Commit

Permalink
Fix execute_service check against allowed accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
rikroe committed Oct 23, 2020
1 parent dba2189 commit 31fa413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Place the folder `bmw_connected_drive` and all it's files in the folder `custom_
See [Github Releases](https://github.com/bimmerconnected/ha_custom_component/releases/).

# Version
Version `20201022.1`
Version `20201023.2`
6 changes: 4 additions & 2 deletions custom_components/bmw_connected_drive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,10 @@ def execute_service(call):
vin = call.data[ATTR_VIN]
vehicle = None
# Double check for read_only accounts as another account could create the services
for account in filter(lambda account: not account.read_only, hass.data[DOMAIN]):
vehicle = account.get_vehicle(vin)
for entity in filter(
lambda entity: not entity.read_only, hass.data[DOMAIN].values()
):
vehicle = entity.account.get_vehicle(vin)
if not vehicle:
_LOGGER.error("Could not find a vehicle for VIN %s", vin)
return
Expand Down

0 comments on commit 31fa413

Please sign in to comment.