-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
tariff/octopusenergy: Refactor / Support API Keys for tariff data lookup #13637
tariff/octopusenergy: Refactor / Support API Keys for tariff data lookup #13637
Conversation
Initial work, more to be done here, committing as I've been working on this most of the evening! Splits GraphQL and Rest out into separate packages. Rest is still required even with GraphQL being available as GraphQL has a lot of restricted endpoints.
validators, etc
Co-authored-by: andig <[email protected]>
…ct Octopus parlance Closes evcc-io#13474 - not a breaking change but deprecates 'tariff'
(I think these are right? @andig halp)
foiled by the linter 😠 can fix tonight? |
Nah, it's build that fails:
copy/paste error? |
Did some small simplifications. Would like to get rid of the token refresh handling- instead use graphQL logging similar to tibber.go? Update I would even think that the logger should already log the token mutations? |
Removed the log, please check if ok for you. |
@@ -111,7 +108,7 @@ func (c *OctopusGraphQLClient) AccountNumber() (string, error) { | |||
return "", errors.New("no account associated with given octopus api key") | |||
} | |||
if len(q.Viewer.Accounts) > 1 { | |||
c.log.WARN.Print("more than one octopus account on this api key - picking the first one. please file an issue!") | |||
return "", errors.New("more than one octopus account on this api key not supported") |
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.
my only proviso on this wording is that it implies we will never support it / people should give up with the integration, whereas we want people to report it so that account selection functionality can be added if necessary - happy to go with breaking loudly though
LGTM (untested) |
This PR adds support for the apikey option on the octopusenergy tariff provider. Using an API key allows for automatic detection of the user's relevant tariff, and also allows for some potentially exciting functionality down the road such as user-specific tariff (and load shedding?) flexibility.
Splits a new GraphQL provider and Rest out into separate packages. Rest is still required even with GraphQL being available as GraphQL has a lot of restricted endpoints / retains backwards compatibility.
Changes the
tariff
config flag toproductcode
as discussed in #13474, and deprecates the former with a warning (not a breaking change).This PR does NOT add support for handling Intelligent Octopus slots - further work required.
Remake of #11555 - see that PR for more context
Closes #13474
Merge simultaneously with evcc-io/docs#509