-
Notifications
You must be signed in to change notification settings - Fork 117
electricity pricing: update prices after config change #3376
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
Open
LKuemmel
wants to merge
2
commits into
openWB:master
Choose a base branch
from
LKuemmel:fix_electricity_pricing_update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 14 additions & 20 deletions
34
packages/modules/electricity_pricing/flexible_tariffs/awattar/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,18 @@ | ||
| from dataclasses import dataclass, field | ||
|
|
||
|
|
||
| @dataclass | ||
| class AwattarTariffConfiguration: | ||
| def __init__(self, | ||
| country: str = "de", | ||
| net: bool = True, | ||
| fix: float = 0.000015, | ||
| proportional: float = 3, | ||
| tax: float = 20) -> None: | ||
| self.country = country | ||
| self.net = net | ||
| self.fix = fix | ||
| self.proportional = proportional | ||
| self.tax = tax | ||
| country: str = "de" | ||
| net: bool = True | ||
| fix: float = 0.000015 | ||
| proportional: float = 3 | ||
| tax: float = 20 | ||
|
|
||
|
|
||
| @dataclass | ||
| class AwattarTariff: | ||
| def __init__(self, | ||
| name: str = "aWATTar/tado° HOURLY", | ||
| type: str = "awattar", | ||
| official: bool = True, | ||
| configuration: AwattarTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or AwattarTariffConfiguration() | ||
| name: str = "aWATTar/tado° HOURLY" | ||
| type: str = "awattar" | ||
| official: bool = True | ||
| configuration: AwattarTariffConfiguration = field(default_factory=AwattarTariffConfiguration) |
25 changes: 12 additions & 13 deletions
25
packages/modules/electricity_pricing/flexible_tariffs/ekz/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| from dataclasses import dataclass, field | ||
|
|
||
|
|
||
| @dataclass | ||
| class EkzTariffConfiguration: | ||
| def __init__(self): | ||
| self.country = "ch" | ||
| self.unit = "Rp" | ||
| self.update_hours = [18, 19] | ||
| country: str = "ch" | ||
| unit: str = "Rp" | ||
| update_hours: list[int] = field(default_factory=lambda: [18, 19]) | ||
|
|
||
|
|
||
| @dataclass | ||
| class EkzTariff: | ||
| def __init__(self, | ||
| name: str = "EKZ (CH)", | ||
| type: str = "ekz", | ||
| official: bool = False, | ||
| configuration: EkzTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or EkzTariffConfiguration() | ||
| name: str = "EKZ (CH)" | ||
| type: str = "ekz" | ||
| official: bool = False | ||
| configuration: EkzTariffConfiguration = field(default_factory=EkzTariffConfiguration) |
23 changes: 11 additions & 12 deletions
23
packages/modules/electricity_pricing/flexible_tariffs/energycharts/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| from dataclasses import dataclass, field | ||
|
|
||
|
|
||
| @dataclass | ||
| class EnergyChartsTariffConfiguration: | ||
| def __init__(self, country: str = "DE-LU", surcharge: float = 0): | ||
| self.country = country | ||
| self.surcharge = surcharge | ||
| country: str = "DE-LU" | ||
| surcharge: float = 0 | ||
|
|
||
|
|
||
| @dataclass | ||
| class EnergyChartsTariff: | ||
| def __init__(self, | ||
| name: str = "Energy-Charts", | ||
| type: str = "energycharts", | ||
| official: bool = True, | ||
| configuration: EnergyChartsTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or EnergyChartsTariffConfiguration() | ||
| name: str = "Energy-Charts" | ||
| type: str = "energycharts" | ||
| official: bool = True | ||
| configuration: EnergyChartsTariffConfiguration = field(default_factory=EnergyChartsTariffConfiguration) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 11 additions & 12 deletions
23
packages/modules/electricity_pricing/flexible_tariffs/groupe_e/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| from dataclasses import dataclass, field | ||
|
|
||
|
|
||
| @dataclass | ||
| class GroupeETariffConfiguration: | ||
| def __init__(self): | ||
| self.country = "ch" | ||
| self.unit = "Rp" | ||
| country: str = "ch" | ||
| unit: str = "Rp" | ||
|
|
||
|
|
||
| @dataclass | ||
| class GroupeETariff: | ||
| def __init__(self, | ||
| name: str = "Groupe E (CH)", | ||
| type: str = "groupe_e", | ||
| official: bool = False, | ||
| configuration: GroupeETariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or GroupeETariffConfiguration() | ||
| name: str = "Groupe E (CH)" | ||
| type: str = "groupe_e" | ||
| official: bool = False | ||
| configuration: GroupeETariffConfiguration = field(default_factory=GroupeETariffConfiguration) |
26 changes: 10 additions & 16 deletions
26
packages/modules/electricity_pricing/flexible_tariffs/octopusenergy/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,17 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Optional | ||
|
|
||
|
|
||
| @dataclass | ||
| class OctopusEnergyTariffConfiguration: | ||
| def __init__(self, | ||
| email: Optional[str] = None, | ||
| accountId: Optional[str] = None, | ||
| password: Optional[str] = None): | ||
| self.email = email | ||
| self.accountId = accountId | ||
| self.password = password | ||
| email: Optional[str] = None | ||
| accountId: Optional[str] = None | ||
| password: Optional[str] = None | ||
|
|
||
|
|
||
| @dataclass | ||
| class OctopusEnergyTariff: | ||
| def __init__(self, | ||
| name: str = "Octopus Energy Deutschland", | ||
| type: str = "octopusenergy", | ||
| official: bool = False, | ||
| configuration: OctopusEnergyTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or OctopusEnergyTariffConfiguration() | ||
| name: str = "Octopus Energy Deutschland" | ||
| type: str = "octopusenergy" | ||
| official: bool = False | ||
| configuration: OctopusEnergyTariffConfiguration = field(default_factory=OctopusEnergyTariffConfiguration) |
28 changes: 11 additions & 17 deletions
28
packages/modules/electricity_pricing/flexible_tariffs/ostrom/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,18 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Optional | ||
|
|
||
|
|
||
| @dataclass | ||
| class OstromTariffConfiguration: | ||
| def __init__(self, | ||
| client_id: Optional[str] = None, | ||
| client_secret: Optional[str] = None, | ||
| zip: Optional[str] = None): | ||
| self.client_id = client_id | ||
| self.client_secret = client_secret | ||
| self.zip = zip | ||
| self.update_hours = [2, 8, 14, 20] # expected time to get next chunk of prices | ||
| client_id: Optional[str] = None | ||
| client_secret: Optional[str] = None | ||
| zip: Optional[str] = None | ||
| update_hours: list[int] = field(default_factory=lambda: [2, 8, 14, 20]) # expected time to get next chunk of prices | ||
|
|
||
|
|
||
| @dataclass | ||
| class OstromTariff: | ||
| def __init__(self, | ||
| name: str = "ostrom", | ||
| type: str = "ostrom", | ||
| official: bool = False, | ||
| configuration: OstromTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or OstromTariffConfiguration() | ||
| name: str = "ostrom" | ||
| type: str = "ostrom" | ||
| official: bool = False | ||
| configuration: OstromTariffConfiguration = field(default_factory=OstromTariffConfiguration) |
26 changes: 11 additions & 15 deletions
26
packages/modules/electricity_pricing/flexible_tariffs/rabot/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,18 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Optional | ||
|
|
||
|
|
||
| @dataclass | ||
| class RabotTariffConfiguration: | ||
| def __init__(self, | ||
| customer_number: Optional[str] = None, | ||
| contract_number: Optional[str] = None): | ||
| self.customer_number = customer_number | ||
| self.contract_number = contract_number | ||
| self.update_hours = [0] # Rabot publishes once daily at 00:00 for the following day | ||
| customer_number: Optional[str] = None | ||
| contract_number: Optional[str] = None | ||
| # Rabot publishes once daily at 00:00 for the following day | ||
| update_hours: list[int] = field(default_factory=lambda: [0]) | ||
|
|
||
|
|
||
| @dataclass | ||
| class RabotTariff: | ||
| def __init__(self, | ||
| name: str = "Rabot", | ||
| type: str = "rabot", | ||
| official: bool = True, | ||
| configuration: RabotTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or RabotTariffConfiguration() | ||
| name: str = "Rabot" | ||
| type: str = "rabot" | ||
| official: bool = True | ||
| configuration: RabotTariffConfiguration = field(default_factory=RabotTariffConfiguration) |
27 changes: 12 additions & 15 deletions
27
packages/modules/electricity_pricing/flexible_tariffs/tibber/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,22 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Optional | ||
|
|
||
|
|
||
| @dataclass | ||
| class TibberTariffConfiguration: | ||
| def __init__(self, token: Optional[str] = None, home_id: Optional[str] = None): | ||
| self.token = token | ||
| self.home_id = home_id | ||
| self.update_hours = [14] # tibber publishes once daily before 14:00 | ||
| ''' | ||
| token: Optional[str] = None | ||
| home_id: Optional[str] = None | ||
| update_hours: list[int] = field(default_factory=lambda: [14]) # tibber publishes once daily before 14:00 | ||
| ''' | ||
| dynamische Netzentgelte müssen umgerechnet werden, | ||
| damit der Gesamtpreis nicht um den Normalpreis der Netzentgelte verzerrt wird. | ||
| ''' | ||
| self.includes_grid_fee = True | ||
| includes_grid_fee: bool = True | ||
|
|
||
|
|
||
| @dataclass | ||
| class TibberTariff: | ||
| def __init__(self, | ||
| name: str = "Tibber", | ||
| type: str = "tibber", | ||
| official: bool = True, | ||
| configuration: TibberTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or TibberTariffConfiguration() | ||
| name: str = "Tibber" | ||
| type: str = "tibber" | ||
| official: bool = True | ||
| configuration: TibberTariffConfiguration = field(default_factory=TibberTariffConfiguration) |
39 changes: 15 additions & 24 deletions
39
packages/modules/electricity_pricing/flexible_tariffs/voltego/config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,33 +1,24 @@ | ||
| from dataclasses import dataclass, field | ||
| from typing import Optional | ||
|
|
||
|
|
||
| class VoltegoToken(): | ||
| def __init__(self, | ||
| access_token: Optional[str] = None, | ||
| expires_in: Optional[str] = None, | ||
| created_at: Optional[str] = None) -> None: | ||
| self.access_token = access_token # don't show in UI | ||
| self.expires_in = expires_in # don't show in UI | ||
| self.created_at = created_at # don't show in UI | ||
| @dataclass | ||
| class VoltegoToken: | ||
| access_token: Optional[str] = field(default=None, compare=False, repr=False) # don't show in UI | ||
| expires_in: Optional[str] = field(default=None, compare=False) # don't show in UI | ||
| created_at: Optional[str] = field(default=None, compare=False) # don't show in UI | ||
|
|
||
|
Comment on lines
+5
to
10
|
||
|
|
||
| @dataclass | ||
| class VoltegoTariffConfiguration: | ||
| def __init__(self, | ||
| client_id: Optional[str] = None, | ||
| client_secret: Optional[str] = None, | ||
| token: VoltegoToken = None): | ||
| self.client_id = client_id | ||
| self.client_secret = client_secret | ||
| self.token = token or VoltegoToken() | ||
| client_id: Optional[str] = None | ||
| client_secret: Optional[str] = None | ||
| token: VoltegoToken = field(default_factory=VoltegoToken) | ||
|
|
||
|
|
||
| @dataclass | ||
| class VoltegoTariff: | ||
| def __init__(self, | ||
| name: str = "Voltego", | ||
| type: str = "voltego", | ||
| official: bool = True, | ||
| configuration: VoltegoTariffConfiguration = None) -> None: | ||
| self.name = name | ||
| self.type = type | ||
| self.official = official | ||
| self.configuration = configuration or VoltegoTariffConfiguration() | ||
| name: str = "Voltego" | ||
| type: str = "voltego" | ||
| official: bool = True | ||
| configuration: VoltegoTariffConfiguration = field(default_factory=VoltegoTariffConfiguration) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Umstellung auf dataclasses für die config-Klassen und dann compare=False-Attribut benutzen.