[Support requis] Yahoo weather sunset is false

Domotica gratuit Forums Report a bug Yahoo weather sunset is false

Ce sujet a 3 réponses, 2 participants et a été mis à jour par  K.Rens, il y a 1 an et 1 mois.

4 sujets de 1 à 4 (sur un total de 4)
  • Auteur
    Messages
  • #3317

    macgreg0r
    Participant

    Hello,

    Since a few time my scenes are going crazy, and I wondered why?
    I finaly found why: Yahoo weather sunset is at 1:00 every days. So my scene that are using it are running at night and not the evening.
    I’ve restarted the service but it’s all the same.
    Does any one of you got this problem?

    #3319

    K.Rens
    Admin bbPress

    I found the issue.
    Yahoo changed the format of their time.
    “9:01 pm” became “9:1 pm”

    This means php cannot read it anymore as time.
    A temporary fix for sunrise, but very bad as it will break it as soon as the minutes go into 2 digit minutes (eg: 10) is following line of code:
    $device->values[getValueIndex($device, $sunset->id)]->value = date(“H:i”, strtotime(str_replace(“:”, “:0”,$phpObj->query->results->channel->astronomy->sunset)));
    inside:
    /volume1/web/PulseStation/services/yweather/service-implementation.php

    We are currently working on a permanent smart solution for this weird change in the yahoo api.

    Kind regards,
    K.Rens

    #3341

    macgreg0r
    Participant

    Thanks for your andswer,

    Regarding this issue, I don’t know php, but in shell there are padding functions , eg: 1 padded to 2 digits with “0” will become “01” and if the number is 10, it will not change. mabe a pad filter for hours and minutes of sunset/sunrise before treatment should do the thing, and if Yahoo come back to the old api, there is nothing to do.

    #3489

    K.Rens
    Admin bbPress

    I’ve fixed the code for yahoo weather for this.
    Once I know how to put it inside the PulseStation Add-ons store, I will launch it for everyone.

    Kind regards,
    K.Rens

4 sujets de 1 à 4 (sur un total de 4)

Vous devez être connecté pour répondre à ce sujet.