Skip to content
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

[EdfColorDay Bridge] add new bridge #4370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

floviolleau
Copy link
Contributor

Hi,

I'm adding a new bridge to be able to get the color of the current day and the next day.

Info are based on RTE data: https://www.services-rte.com/fr/visualisez-les-donnees-publiees-par-rte/calendrier-des-offres-de-fourniture-de-type-tempo.html

Screenshot:

image

Copy link

github-actions bot commented Dec 16, 2024

Pull request artifacts

Bridge Context Status
EdfColorDay 1 untitled (pr) Bridge returned error 0! (20073)
Type: ErrorException
Message: Undefined variable $i

last change: Monday 2024-12-16 17:52:39

{
// Set the locale to French
setlocale(LC_TIME, 'fr_FR.UTF-8');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change locale. Can you find another way?

$contract = $this->getKey('contract');

$header = [
'Content-type: application/json',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. This is the content type of the data in the http request. There is none body in request.

You probably meant to use Accept?

See https://stackoverflow.com/questions/35722586/http-headers-accept-and-content-type-in-a-rest-context

*/
private function tempo(string $json): void
{
$jsonDecoded = json_decode($json, true, 512, JSON_THROW_ON_ERROR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out Json::decode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants