Add support for multiple N26 accounts#24345
Conversation
| @@ -15,12 +15,17 @@ def setup_platform( | |||
| hass, config, add_entities, discovery_info=None): | |||
| """Set up the N26 switch platform.""" | |||
| api_data = hass.data[DOMAIN][DATA] | |||
There was a problem hiding this comment.
Please make all the same changes in this module as above.
There was a problem hiding this comment.
I've made all the changes you've mentioned, but can't pass check - it fails for Python 3.7 in module, which I've never thought to change. I suppose that failure is temporary. Can I somehow redo check later?
|
Please add to the breaking change paragraph what the user needs to do to cope with the breaking change. In this case, the user needs to remove existing stale entities from the entity registry. |
| hass, config, add_entities, discovery_info=None): | ||
| """Set up the N26 sensor platform.""" | ||
| api_data = hass.data[DOMAIN][DATA] | ||
| api_list = hass.data[DOMAIN][DATA] |
There was a problem hiding this comment.
Please add a guard clause here that checks if discovery_info is None and return if so.
| api_list = hass.data[DOMAIN][DATA] | ||
|
|
||
| sensor_entities = [N26Account(api_data)] | ||
| if api_list is None: |
There was a problem hiding this comment.
The api_list can never be None. We can remove this.
| api_data = hass.data[DOMAIN][DATA] | ||
| api_list = hass.data[DOMAIN][DATA] | ||
|
|
||
| if api_list is None: |
|
Please rebase on latest dev branch to let the build pass. |
…ytadin component (#24652) * Fix AttributeError: 'NoneType' object has no attribute 'group' * Update sensor.py
* braviatv, nmap_tracker: use getmac for getting MAC addresses Refs #24601 * Move getmac imports to top level
* Breaking change: Rewrite opentherm_gw to add support for more than one OpenTherm Gateway. Breaks config layout and child entity ids and adds a required parameter to all service calls (gateway_id). * Add schema and parameter description for service opentherm_gw.reset_gateway. * Add optional name attribute in config to be used for friendly names. Fix bugs in binary_sensor and climate platforms. * pylint fixes * Remove unused variables. * Update manifest.json, remove REQUIREMENTS from .py file * Update CODEOWNERS * Address issues that were brought up (requested changes): - Move imports to module level - Change certain functions from async to sync - Move constants to const.py (new file) - Call gateway setup from outside of __init__() - Move validation of monitored_variables to config schema * Address requested changes: - Make module imports relative - Move more functions from async to sync, decorate with @callback where necessary - Remove monitored_variables option, add all sensors by default
* Vlc telnet first commit First functional version, remains to add more functionality. * New functions added and bugfixes * Compliance with dev checklist * Compliance with dev checklist * Compliance with pydocstyle * Removed unused import * Fixed wrong reference for exception * Module renamed * Fixed module rename in other * Fixed wrong reference for exception Module renamed Fixed module rename in other * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Suggestions by @OttoWinter +Manage error when the VLC dissapears to show status unavailable. * Removed error log, instead set unavailable state * Changes suggested by @pvizeli -Import location -Use of constants * Implemented available method * Improved available method
* Clean up Google Config * Lint * pylint * pylint2
* Vlc telnet first commit First functional version, remains to add more functionality. * New functions added and bugfixes * Compliance with dev checklist * Compliance with dev checklist * Compliance with pydocstyle * Removed unused import * Fixed wrong reference for exception * Module renamed * Fixed module rename in other * Fixed wrong reference for exception Module renamed Fixed module rename in other * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Update homeassistant/components/vlc_telnet/media_player.py Accepted suggestion by @OttoWinter Co-Authored-By: Otto Winter <otto@otto-winter.com> * Suggestions by @OttoWinter +Manage error when the VLC dissapears to show status unavailable. * Removed error log, instead set unavailable state * Changes suggested by @pvizeli -Import location -Use of constants * Implemented available method * Improved available method
* Improve autodiscovered yeelights model detection * Lint fixes * Logger warn fix
* Add extra_module_url and extra_module_url_es5 to frontend options * Address review comments
Breaking Change:
Changed generation of unique ids for spaces. Previous format was
space_<name>, new format isspace_<iban[-4:]_<name>. Otherwise we cannot guarantee uniqueness of ids in case of two accounts have spaces with same name, f.e. "main" spaces have always same name by default.The stale spaces (with old ids) need to be removed from registry.
Description:
Added support for multiple N26 accounts.
Docs PR:
home-assistant/home-assistant.io#9577
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.If the code does not interact with devices: