-
-
Notifications
You must be signed in to change notification settings - Fork 29.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extra sensors by adding support to the extended ESIOS API with API Token #85601
Add extra sensors by adding support to the extended ESIOS API with API Token #85601
Conversation
* Access API with optional token defined in config entry * Handle `BadApiTokenAuthError` to raise `ConfigEntryAuthFailed` * Expect config-flow options to change power attrs and API token, but not the PVPC tariff * Remove deprecated `CONFIG_SCHEMA`
Evolve `ElecPriceSensor` to work with multiple sensors, relying on `coordinator.data` to store the downloaded info for all sensors New sensors added: - Injection price: price of excess energy from self-consumption - OMIE price: electricity price in the 'open' market - MAG price: Temporal tax cost for gas compensation
* Add 'api_token' and (bool)'use_api_token' to config entry data to handle both ways of setup. * Fill the token in a second step if the boolean is cheched * Add verify method to check valid API token in config-flow before entry creation * Add reauth + reauth_confirm steps to trigger re-config if the token fails anytime * Enable option to define (or disable) the API token for current installs * Add info about how to get the token in the config-flow step, with a direct link to generate the request email
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR contains a whole lot of things that don't have to be in a single PR.
It contains dependency bumps, refactoring, new features...
Please split the PR out into multiple smaller PRs so we can get there in tinier but quicker steps.
Thanks 👍
../Frenck
Sorry @frenck 🙈, wasn't my initial intention to make it so big 😰. Most of it are new fixtures, but you're totally right, there is too much here 😢 Ok, I'll try to split it, but not sure how, for the most part. How about?
|
Closed, to be split in parts:
|
Proposed change
Add support to the extended ESIOS API, adding 3 more price sensors when using an ESIOS API Token
DataUpdateCoordinator
andSensorEntityDescription
SOURCE_IMPORT
)Detailed changes
aiopvpc
version to v4.0.0Release notes: https://github.com/azogue/aiopvpc/releases/tag/v4.0.0
Changelog: https://github.com/azogue/aiopvpc/blob/master/CHANGELOG.md
Diff/compare against current version: azogue/aiopvpc@v3.0.0...v4.0.0
DataUpdateCoordinator
for multiple sensors withEsiosApiData
BadApiTokenAuthError
to raiseConfigEntryAuthFailed
CONFIG_SCHEMA
ElecPriceSensor
to work with multiple sensors,relying on
coordinator.data
to store the downloaded info for all sensorsNew sensors added:
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: