Skip to content

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