hass-core/tests
Eugenio Panadero b96d2cadac
Add new price sensors with API token access to pvpc hourly pricing (#85769)
*  Implement optional API token in config-flow + options

to make the data download from an authenticated path in ESIOS server

As this is an *alternative* access, and current public path works for the PVPC,
no user (current or new) is compelled to obtain a token,
and it can be enabled anytime in options, or doing the setup again

When enabling the token, it is verified (or "invalid_auth" error),
and a 'reauth' flow is implemented, which can change or disable the token if
it starts failing.

The 1st step of config/options flow adds a bool to enable this private access,
- if unchecked (default), entry is set for public access (like before)
- if checked, a 2nd step opens to input the token, with instructions
  of how to get one (with a direct link to create a 'request email').
  If the token is valid, the entry is set for authenticated access

The 'reauth' flow shows the boolean flag so the user could disable a bad token
by unchecking the boolean flag 'use_api_token'

* ♻️ Remove storage of flag 'use_api_token' in config entry

leaving it only to enable/disable the optional token in the config-flow

* ♻️ Adjust async_update_options

*  Add new price sensors with API token access

New price 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

*  Adapt tests to work with multiple sensors

* 🐛 Fix all integration sensors going unavailable

when any sensor lacks data for the current day (usually the 'OMIE price')

* Fix rebase

* Customize icons and display precision for new sensors

* Disable MAG Tax and OMIE price sensors by default

* Move logic to assign sensor unique ids to integration

* Move helper functions to helpers.py

* Fix sensor activation for API download
2023-12-18 21:06:02 +01:00
..
auth Migrate auth tests to use freezegun (#105243) 2023-12-07 21:18:10 +01:00
components Add new price sensors with API token access to pvpc hourly pricing (#85769) 2023-12-18 21:06:02 +01:00
fixtures Add domain key config validation (#104242) 2023-12-05 15:07:32 +01:00
hassfest
helpers Allow step size any for number selector in slider mode (#105978) 2023-12-18 15:30:59 +01:00
pylint
resources
scripts Use modern platform path when reporting platform config errors (#104238) 2023-12-05 15:06:13 +01:00
snapshots Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
test_util Extend auth/providers endpoint and add /api/person/list endpoint for local ip requests (#103906) 2023-11-24 17:11:54 +01:00
testing_config Use ServiceValidationError for invalid fan preset_mode and move check to fan entity component (#104560) 2023-11-29 13:56:51 +01:00
util Reduce overhead to connect dispatcher (#105715) 2023-12-16 10:16:58 +01:00
__init__.py
common.py Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
conftest.py Remove HaAsyncServiceBrowser from zeroconf (#105881) 2023-12-18 14:11:06 +01:00
ignore_uncaught_exceptions.py
patch_time.py
ruff.toml
syrupy.py
test_bootstrap.py Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
test_config.py Add domain key config validation (#104242) 2023-12-05 15:07:32 +01:00
test_config_entries.py Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
test_core.py Migrate non-component tests to use freezegun/freezer (#105142) 2023-12-07 22:58:09 +01:00
test_data_entry_flow.py
test_exceptions.py
test_loader.py
test_main.py
test_requirements.py Switch formatting from black to ruff-format (#102893) 2023-11-27 14:38:59 +01:00
test_runner.py Trigger Home Assistant shutdown automations right before the stop event instead of during it (#91165) 2023-12-05 11:24:41 -10:00
test_setup.py Reverse component path (#104087) 2023-12-05 08:43:58 +01:00
test_test_fixtures.py Patch aiohttp server app router freeze in tests (#105555) 2023-12-12 14:40:38 +01:00
typing.py