Fixed Tibber API breaking changes (Dec 2022) #28
Closed
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.








The PR aims to quick fix the breaking changes introduced by the tibber API
https://developer.tibber.com/docs/overview#breaking-websocket-change
After brief research the it felt like exactly the opposite, that graphql-transport-ws would be the deprecated one.
The graphql library that was picked only supports graphql-ws, so I hope they accept my PR to add the other subprotocol as well. For the time being, I pointed my the reference to my repository with the fix in the graphql library. Once their PR is merged we can point it to the official one again. I guess this is better as to have a fully broken exporter.
This was the error message I encountered:
I compared the websocket messages with Tibbers GraphQL playground and found the mismatching ws subprotocols.
Also they have changed the GraphQL Subscription URL. It would be better to get them dynamically from the GraphQL query API. My Python skills didn't allow to also do that quickly so I just updated the URL.