Commit graph

132 commits

Author SHA1 Message Date
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
Eugenio Panadero
3c72cd7612
Await step in config-flow instead of moving to another form (#104412)
* Await step in config-flow instead of moving to another form

* Fix call to step-api-token

* Fix condition in step-api-token
2023-11-24 11:28:49 +01:00
Eugenio Panadero
32aa1aaec2
Add pvpc hourly pricing optional API Token support (#85767)
* 🍱 Add new fixture for PVPC data from authenticated API call

and update mocked server responses when data is not available
(now returns a 200 OK with empty data)

*  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'

* 🌐 Update strings for config/options flows

*  Adapt tests to check API token option and add test_reauth

* 🎨 Link new strings to those in config-flow

* 🐛 tests: Fix mocked date-change with async_fire_time_changed

* ♻️ 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
2023-11-23 08:35:30 +01:00
Joost Lekkerkerker
f28634ea11
Migrate PVPC to has entity name (#98894)
* Migrate PVPC to has entity name

* Set device name

* Fix feedback
2023-08-29 16:26:23 +02:00
Erik Montnemery
045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
Marc Mueller
71cc227f09
Update aiopvpc to 4.2.2 (#97482) 2023-07-30 18:54:45 +02:00
Eugenio Panadero
1fb11aec26
Bump aiopvpc to 4.1.0 (#89593) 2023-03-13 09:07:10 +01:00
Erik Montnemery
5dfb9cddd6
Sort manifests 8 (#87029) 2023-02-08 20:13:46 +01:00
Franck Nijhof
939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
GitHub Action
d1ecc418bb [ci skip] Translation update 2023-01-19 00:25:04 +00:00
GitHub Action
d2e11797f8 [ci skip] Translation update 2023-01-17 00:24:30 +00:00
GitHub Action
b81453cb6b [ci skip] Translation update 2023-01-16 00:24:22 +00:00
GitHub Action
dffc913f9e [ci skip] Translation update 2023-01-14 00:22:57 +00:00
Eugenio Panadero
d748894b88
Remove 'tariff' edition from options-flow (#85703)
* 🎨 Add missing typing for config-flow

* 🐛 Remove 'tariff' edition from options-flow

The `entry.data["tariff"]` is what makes the `entry.unique_id`,
so it's an incoherence to be able to change it in the Options flow

* 🌐 Update generated EN translation

* 🎨 Link translations of option-flow to those of config-flow
2023-01-13 13:27:11 +01:00
Eugenio Panadero
05590f63c9
Clean attributes in pvpc hourly pricing ElecPriceSensor (#85688)
♻️ Remove unnecessary private attrs and fix typing for sensor entity
2023-01-12 03:21:16 +01:00
Eugenio Panadero
77feaecbfa
Remove unreachable config entry migration in pvpc hourly pricing (#85700)
* 🔥 Remove old config entry migration logic

introduced for a breaking change in 2021-06, now unreachable after
completely disabling the YAML config for the integration

*  Remove test for old config entry migration logic

and adjust existent one for config-flow to do not lose coverage
2023-01-12 01:07:11 +01:00
Eugenio Panadero
2286029b5d
Bump aiopvpc to 4.0.1 (#85612)
* 📦️ Bump aiopvpc version

* ♻️ Evolve DataUpdateCoordinator and PVPC sensor for new aiopvpc

setting `SensorDeviceClass.MONETARY` for the price sensor

* 🍱 tests: Update tests fixtures with new sensor data

for aiopvpc v4 with 'esios_public' as data-source

*  tests: Adapt test suite for new default data-source

* 📦️ Bump aiopvpc version for latest patch 4.0.1

* ️ Revert changes unrelated to library bump

* ️ Revert tests changes unrelated to library bump
2023-01-11 14:49:42 +01:00
Eugenio Panadero
caa8fc4d10
Remove deprecated YAML manual config for PVPC Hourly Pricing (#85614) 2023-01-10 20:49:54 +01:00
GitHub Action
01e99c0229 [ci skip] Translation update 2023-01-05 00:23:39 +00:00
Franck Nijhof
94755a5773
String formatting and max line length - Part 4 (#84445)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2022-12-23 13:27:27 +01:00
epenet
ebdf9a8658
Use UnitOfEnergy in integrations (o-z) (#84221) 2022-12-19 10:58:37 +01:00
GitHub Action
f3b3193f7a [ci skip] Translation update 2022-11-25 00:24:19 +00:00
GitHub Action
eaf6d43508 [ci skip] Translation update 2022-11-23 00:26:26 +00:00
GitHub Action
3e9c0f18f9 [ci skip] Translation update 2022-09-25 00:28:01 +00:00
GitHub Action
cb46441b74 [ci skip] Translation update 2022-08-05 00:28:51 +00:00
GitHub Action
81e3ef03f7 [ci skip] Translation update 2022-08-02 00:27:42 +00:00
GitHub Action
1d2e64e3dc [ci skip] Translation update 2022-07-14 00:27:41 +00:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
epenet
42ed0fd47b
Add async_get_options_flow type hints (n-z) (#73431) 2022-06-13 13:30:41 +02:00
GitHub Action
b6b72f50ec [ci skip] Translation update 2022-05-22 00:22:43 +00:00
GitHub Action
3a13ffcf13 [ci skip] Translation update 2022-05-19 00:26:11 +00:00
GitHub Action
37f81b261d [ci skip] Translation update 2022-05-16 00:24:28 +00:00
GitHub Action
348016dbbf [ci skip] Translation update 2022-04-29 00:22:21 +00:00
Paulus Schoutsen
5eee600fa8
Ban brand name translations as step titles (#68801) 2022-03-28 10:41:39 -07:00
Marc Mueller
b664bcd007
Update coordinator typing (4) [o-p] (#68464) 2022-03-21 14:45:24 +01:00
GitHub Action
2957f4ce85 [ci skip] Translation update 2022-03-07 00:18:40 +00:00
GitHub Action
102ae9f0e3 [ci skip] Translation update 2022-02-22 00:17:23 +00:00
GitHub Action
2da4d280b2 [ci skip] Translation update 2022-02-06 00:17:31 +00:00
GitHub Action
ca7d4234e1 [ci skip] Translation update 2022-01-31 00:14:28 +00:00
GitHub Action
77ef86faee [ci skip] Translation update 2022-01-30 00:14:21 +00:00
J. Nick Koston
5b755b74fb
Add loggers to integration manifest.json (#65083) 2022-01-28 13:37:53 -08:00
GitHub Action
dd4e5bb9c5 [ci skip] Translation update 2022-01-27 00:14:02 +00:00
Marc Mueller
67c35652f0
Update typing - collections.abc (2) (#63934) 2022-01-12 09:04:37 +01:00
Marc Mueller
021debb5c5
Resolve implicit imports (#63832) 2022-01-10 17:10:46 +01:00
Eugenio Panadero
f422dd418b
Fix pvpc_hourly_pricing by changing data source and modernise integration (#62591) 2021-12-23 17:08:40 +01:00
GitHub Action
d4f8a7c056 [ci skip] Translation update 2021-12-17 00:14:01 +00:00
Robert Hillis
b7ece5ae00
Use enums in pvpc_hourly_pricing (#62076) 2021-12-16 23:27:15 +01:00
GitHub Action
f75b325ab2 [ci skip] Translation update 2021-12-12 00:14:30 +00:00
Marc Mueller
79cd281c48
Use platform enum (5) [P-R] (#60943) 2021-12-04 13:19:49 +01:00
Eugenio Panadero
923cb0f4b7
Bump aiopvpc to 2.2.4 to fix price sensor attributes for pvpc_hourly_pricing (#60012) 2021-11-29 16:57:32 +01:00