Skip to content

BMW Connected drive: option to disable the services#15993

Merged
balloob merged 12 commits intohome-assistant:devfrom
Alexxander0:dev
Aug 16, 2018
Merged

BMW Connected drive: option to disable the services#15993
balloob merged 12 commits intohome-assistant:devfrom
Alexxander0:dev

Conversation

@Alexxander0
Copy link
Copy Markdown
Contributor

Description:

I dont want to expose the services of my car to HA. The services"light turn on", "unlock" etc. should be disabled for security reasons. This PR adds an option to disable the services and lock

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6024

Example entry for configuration.yaml (if applicable):

bmw_connected_drive:
  name:
    username: !secret bmw_username
    password: !secret bmw_password
    region: !secret bmw_region
    services: false

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @Alexxander0,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

enable_services = account_config[CONF_ENABLE_SERVICES]
_LOGGER.debug('Adding new account %s', name)
cd_account = BMWConnectedDriveAccount(username, password, region, name)
cd_account = BMWConnectedDriveAccount(username, password, region, name,enable_services)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','
line too long (91 > 79 characters)

enable_services = account_config[CONF_ENABLE_SERVICES]
_LOGGER.debug('Adding new account %s', name)
cd_account = BMWConnectedDriveAccount(username, password, region, name)
cd_account = BMWConnectedDriveAccount(username, password, region, name, enable_services)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (92 > 79 characters)

_LOGGER.debug('Adding new account %s', name)
cd_account = BMWConnectedDriveAccount(username, password, region, name)
cd_account = BMWConnectedDriveAccount(username, password, region, name,
enable_services)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

enable_services = account_config[CONF_ENABLE_SERVICES]
_LOGGER.debug('Adding new account %s', name)
cd_account = BMWConnectedDriveAccount(username, password, region, name)
cd_account = BMWConnectedDriveAccount(username, password, region, name,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace


DOMAIN = 'bmw_connected_drive'
CONF_REGION = 'region'
CONF_ENABLE_SERVICES = 'services'
Copy link
Copy Markdown
Member

@balloob balloob Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename the option to read_only and default it to False

Copy link
Copy Markdown
Contributor Author

@Alexxander0 Alexxander0 Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean CONF_READ_ONLY = 'services' ? This wouldnt make it consistent, because there is always a negation needed. I could do CONF_READ_ONLY = 'services_disabled' and set the default to false ?
Or CONF_READ_ONLY = 'read_only'

@balloob balloob merged commit e9e5bce into home-assistant:dev Aug 16, 2018
@ghost ghost removed the in progress label Aug 16, 2018
@balloob balloob mentioned this pull request Aug 29, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
…5993)

* Update __init__.py

* Update bmw_connected_drive.py

* Update __init__.py

* Update bmw_connected_drive.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update bmw_connected_drive.py
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants