Add services for bmw_connected_drive#13497
Add services for bmw_connected_drive#13497MartinHjelmare merged 11 commits intohome-assistant:devfrom
Conversation
There was a problem hiding this comment.
Is trackr_id used for something specific? As this field has the same value as id it seems a bit double.
There was a problem hiding this comment.
CONF_ constants are only used in config schemas. Here you want to use ATTR_ in the service schema.
There was a problem hiding this comment.
Do this directly in setup instead.
There was a problem hiding this comment.
Make function to handle service calls directly inside setup instead. You have access to this instance there, so this doesn't have to be a method here.
There was a problem hiding this comment.
Service handlers don't return anything.
There was a problem hiding this comment.
Remove this, it's duplicate info from host_name.
|
Please also document the services in the docs. |
|
Good point @pvizeli. @ChristianKuehnel |
|
@pvizeli @MartinHjelmare Added documentation for the services (see link above). |
There was a problem hiding this comment.
local variable 'result' is assigned to but never used
There was a problem hiding this comment.
'bimmer_connected.remote_services.ExecutionState' imported but unused
695641d to
641c468
Compare
* added vin to attributes of tracker * moved component to new package * added service description
"Cell variable bimmer defined in loop (cell-var-from-loop)"
641c468 to
e4d3b36
Compare
|
Build failed because of flaky test --> re-triggering build with open/close. |
MartinHjelmare
left a comment
There was a problem hiding this comment.
Some minor comments left to attend. Otherwise looks good!
|
|
||
| for account in accounts: | ||
| account.update() | ||
| def _update_all(_) -> None: |
There was a problem hiding this comment.
Please add a parameter, service or call, even though you don't use it, it's clearer and according to our standard.
| account.update() | ||
| def _update_all(_) -> None: | ||
| """Update all BMW accounts.""" | ||
| for account_update in hass.data[DOMAIN]: |
There was a problem hiding this comment.
Below you call the item bimmer. Why not call it the same here? It would read nicer.
There was a problem hiding this comment.
ACK calling the object cd_account (Connected Drive Account).
| object here. | ||
| """ | ||
| vin = call.data[ATTR_VIN] | ||
| _LOGGER.debug('Triggering service %s of vehicle %s', |
There was a problem hiding this comment.
This is already logged in the core at info level.
|
|
||
| # register the remote services | ||
| for service in _SERVICE_MAP: | ||
| _LOGGER.debug('Registering service %s', service) |
There was a problem hiding this comment.
We usually don't log this.
MartinHjelmare
left a comment
There was a problem hiding this comment.
Great! Can be merged when build passes.
Description:
Added services to bmw_connected_drive so that the Remote Services of the vehicle can also be triggered from Home Assistant.
Related issue (if applicable): N/A
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5055
Example entry for
configuration.yaml(if applicable):no changes
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed: