[mythtv-commits] Ticket #13206: Mythweather 6 day forecast does not display high temperatures

MythTV noreply at mythtv.org
Fri Jan 19 05:43:37 UTC 2018


#13206: Mythweather 6 day forecast does not display high temperatures
----------------------------------------+--------------------------
     Reporter:  Steve Fatula <steve@…>  |      Owner:
         Type:  Bug Report - General    |     Status:  new
     Priority:  minor                   |  Milestone:  needs_triage
    Component:  Plugin - MythWeather    |    Version:  v29-fixes
     Severity:  medium                  |   Keywords:  mythweather
Ticket locked:  0                       |
----------------------------------------+--------------------------
 Mythweather perl script yrnoxml.pl does not show high temperatures as is.
 It actually seems to pick the last time range in the xml file it gets. In
 my case, this is midnight to 6AM, hardly the high temperature! It appears
 to capture the last timerange in the xml file, and, use that to determine
 each days highs. Here's my locations xml results section for the
 temperatures at the end. I will also attach what it shows on the display.
 You'll note, for example, that the high on the 21st (Sunday) shows at 54
 in mythweather, when actually that's the low! The main problem would
 appear to be the variable $lastperiod. Instead of using that logic, if one
 wanted the high, perhaps instead it should browse the days temps and pick
 the highest one since really it could be at any time of day. Failing that,
 it should pick as lastdate the highest date bucket numerically perhaps.

 I can fix the code abd submit a patch if need be, just give me your
 preference if you agree this is a bug. If I understand correctly, the file
 timestamps are in local time since there is no offset and therefore no
 timezone logic is needed for those time ranges.


 {{{
   <forecast>
     <tabular>
       <time from="2018-01-18T23:00:00" to="2018-01-19T00:00:00"
 period="3">
         <!-- Valid from 2018-01-18T23:00:00 to 2018-01-19T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-18T23:00:00 -->
         <windDirection deg="191.5" code="SSW" name="South-southwest" />
         <windSpeed mps="3.5" name="Gentle breeze" />
         <temperature unit="celsius" value="-1" />
         <pressure unit="hPa" value="1027.1" />
       </time>
       <time from="2018-01-19T00:00:00" to="2018-01-19T06:00:00"
 period="0">
         <!-- Valid from 2018-01-19T00:00:00 to 2018-01-19T06:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-19T00:00:00 -->
         <windDirection deg="190.1" code="S" name="South" />
         <windSpeed mps="3.5" name="Gentle breeze" />
         <temperature unit="celsius" value="-2" />
         <pressure unit="hPa" value="1026.7" />
       </time>
       <time from="2018-01-19T06:00:00" to="2018-01-19T12:00:00"
 period="1">
         <!-- Valid from 2018-01-19T06:00:00 to 2018-01-19T12:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-19T06:00:00 -->
         <windDirection deg="190.2" code="S" name="South" />
         <windSpeed mps="3.7" name="Gentle breeze" />
         <temperature unit="celsius" value="-2" />
         <pressure unit="hPa" value="1023.6" />
       </time>
       <time from="2018-01-19T12:00:00" to="2018-01-19T18:00:00"
 period="2">
         <!-- Valid from 2018-01-19T12:00:00 to 2018-01-19T18:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-19T12:00:00 -->
         <windDirection deg="200.7" code="SSW" name="South-southwest" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1021.4" />
       </time>
       <time from="2018-01-19T18:00:00" to="2018-01-20T00:00:00"
 period="3">
         <!-- Valid from 2018-01-19T18:00:00 to 2018-01-20T00:00:00 -->
         <symbol number="3" numberEx="3" name="Partly cloudy" var="03n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-19T18:00:00 -->
         <windDirection deg="175.7" code="S" name="South" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="6" />
         <pressure unit="hPa" value="1017.0" />
       </time>
       <time from="2018-01-20T00:00:00" to="2018-01-20T06:00:00"
 period="0">
         <!-- Valid from 2018-01-20T00:00:00 to 2018-01-20T06:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-20T00:00:00 -->
         <windDirection deg="186.1" code="S" name="South" />
         <windSpeed mps="5.3" name="Gentle breeze" />
         <temperature unit="celsius" value="7" />
         <pressure unit="hPa" value="1018.2" />
       </time>
       <time from="2018-01-20T06:00:00" to="2018-01-20T12:00:00"
 period="1">
         <!-- Valid from 2018-01-20T06:00:00 to 2018-01-20T12:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-20T06:00:00 -->
         <windDirection deg="174.6" code="S" name="South" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1015.4" />
       </time>
       <time from="2018-01-20T12:00:00" to="2018-01-20T18:00:00"
 period="2">
         <!-- Valid from 2018-01-20T12:00:00 to 2018-01-20T18:00:00 -->
         <symbol number="2" numberEx="2" name="Fair" var="02d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-20T12:00:00 -->
         <windDirection deg="185.1" code="S" name="South" />
         <windSpeed mps="6.5" name="Moderate breeze" />
         <temperature unit="celsius" value="13" />
         <pressure unit="hPa" value="1015.4" />
       </time>
       <time from="2018-01-20T18:00:00" to="2018-01-21T00:00:00"
 period="3">
         <!-- Valid from 2018-01-20T18:00:00 to 2018-01-21T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-20T18:00:00 -->
         <windDirection deg="168.2" code="SSE" name="South-southeast" />
         <windSpeed mps="4.8" name="Gentle breeze" />
         <temperature unit="celsius" value="13" />
         <pressure unit="hPa" value="1012.3" />
       </time>
       <time from="2018-01-21T00:00:00" to="2018-01-21T06:00:00"
 period="0">
         <!-- Valid from 2018-01-21T00:00:00 to 2018-01-21T06:00:00 -->
         <symbol number="3" numberEx="3" name="Partly cloudy" var="03n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-21T00:00:00 -->
         <windDirection deg="179.0" code="S" name="South" />
         <windSpeed mps="5.5" name="Moderate breeze" />
         <temperature unit="celsius" value="12" />
         <pressure unit="hPa" value="1013.3" />
       </time>
       <time from="2018-01-21T06:00:00" to="2018-01-21T12:00:00"
 period="1">
         <!-- Valid from 2018-01-21T06:00:00 to 2018-01-21T12:00:00 -->
         <symbol number="9" numberEx="9" name="Rain" var="09" />
         <precipitation value="1.4" />
         <!-- Valid at 2018-01-21T06:00:00 -->
         <windDirection deg="188.7" code="S" name="South" />
         <windSpeed mps="5.2" name="Gentle breeze" />
         <temperature unit="celsius" value="13" />
         <pressure unit="hPa" value="1012.3" />
       </time>
       <time from="2018-01-21T12:00:00" to="2018-01-21T18:00:00"
 period="2">
         <!-- Valid from 2018-01-21T12:00:00 to 2018-01-21T18:00:00 -->
         <symbol number="5" numberEx="40" name="Light rain showers"
 var="40d" />
         <precipitation value="0.6" />
         <!-- Valid at 2018-01-21T12:00:00 -->
         <windDirection deg="204.0" code="SSW" name="South-southwest" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="16" />
         <pressure unit="hPa" value="1011.0" />
       </time>
       <time from="2018-01-21T18:00:00" to="2018-01-22T00:00:00"
 period="3">
         <!-- Valid from 2018-01-21T18:00:00 to 2018-01-22T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-21T18:00:00 -->
         <windDirection deg="188.5" code="S" name="South" />
         <windSpeed mps="4.3" name="Gentle breeze" />
         <temperature unit="celsius" value="17" />
         <pressure unit="hPa" value="1007.1" />
       </time>
       <time from="2018-01-22T00:00:00" to="2018-01-22T06:00:00"
 period="0">
         <!-- Valid from 2018-01-22T00:00:00 to 2018-01-22T06:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-22T00:00:00 -->
         <windDirection deg="257.9" code="WSW" name="West-southwest" />
         <windSpeed mps="4.0" name="Gentle breeze" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1009.6" />
       </time>
       <time from="2018-01-22T06:00:00" to="2018-01-22T12:00:00"
 period="1">
         <!-- Valid from 2018-01-22T06:00:00 to 2018-01-22T12:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-22T06:00:00 -->
         <windDirection deg="292.2" code="WNW" name="West-northwest" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="5" />
         <pressure unit="hPa" value="1015.2" />
       </time>
       <time from="2018-01-22T12:00:00" to="2018-01-22T18:00:00"
 period="2">
         <!-- Valid from 2018-01-22T12:00:00 to 2018-01-22T18:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-22T12:00:00 -->
         <windDirection deg="291.8" code="WNW" name="West-northwest" />
         <windSpeed mps="6.6" name="Moderate breeze" />
         <temperature unit="celsius" value="10" />
         <pressure unit="hPa" value="1016.9" />
       </time>
       <time from="2018-01-22T18:00:00" to="2018-01-23T00:00:00"
 period="3">
         <!-- Valid from 2018-01-22T18:00:00 to 2018-01-23T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-22T18:00:00 -->
         <windDirection deg="293.5" code="WNW" name="West-northwest" />
         <windSpeed mps="4.1" name="Gentle breeze" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1017.7" />
       </time>
       <time from="2018-01-23T00:00:00" to="2018-01-23T06:00:00"
 period="0">
         <!-- Valid from 2018-01-23T00:00:00 to 2018-01-23T06:00:00 -->
         <symbol number="3" numberEx="3" name="Partly cloudy" var="03n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-23T00:00:00 -->
         <windDirection deg="287.5" code="WNW" name="West-northwest" />
         <windSpeed mps="2.7" name="Light breeze" />
         <temperature unit="celsius" value="4" />
         <pressure unit="hPa" value="1020.4" />
       </time>
       <time from="2018-01-23T06:00:00" to="2018-01-23T12:00:00"
 period="1">
         <!-- Valid from 2018-01-23T06:00:00 to 2018-01-23T12:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-23T06:00:00 -->
         <windDirection deg="325.2" code="NW" name="Northwest" />
         <windSpeed mps="2.4" name="Light breeze" />
         <temperature unit="celsius" value="1" />
         <pressure unit="hPa" value="1022.3" />
       </time>
       <time from="2018-01-23T12:00:00" to="2018-01-23T18:00:00"
 period="2">
         <!-- Valid from 2018-01-23T12:00:00 to 2018-01-23T18:00:00 -->
         <symbol number="3" numberEx="3" name="Partly cloudy" var="03d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-23T12:00:00 -->
         <windDirection deg="345.3" code="NNW" name="North-northwest" />
         <windSpeed mps="1.2" name="Light air" />
         <temperature unit="celsius" value="10" />
         <pressure unit="hPa" value="1024.8" />
       </time>
       <time from="2018-01-23T18:00:00" to="2018-01-24T00:00:00"
 period="3">
         <!-- Valid from 2018-01-23T18:00:00 to 2018-01-24T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-23T18:00:00 -->
         <windDirection deg="241.8" code="WSW" name="West-southwest" />
         <windSpeed mps="1.0" name="Light air" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1023.5" />
       </time>
       <time from="2018-01-24T00:00:00" to="2018-01-24T06:00:00"
 period="0">
         <!-- Valid from 2018-01-24T00:00:00 to 2018-01-24T06:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-24T00:00:00 -->
         <windDirection deg="114.6" code="ESE" name="East-southeast" />
         <windSpeed mps="2.4" name="Light breeze" />
         <temperature unit="celsius" value="2" />
         <pressure unit="hPa" value="1025.3" />
       </time>
       <time from="2018-01-24T06:00:00" to="2018-01-24T12:00:00"
 period="1">
         <!-- Valid from 2018-01-24T06:00:00 to 2018-01-24T12:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-24T06:00:00 -->
         <windDirection deg="77.3" code="ENE" name="East-northeast" />
         <windSpeed mps="1.4" name="Light air" />
         <temperature unit="celsius" value="-1" />
         <pressure unit="hPa" value="1025.9" />
       </time>
       <time from="2018-01-24T12:00:00" to="2018-01-24T18:00:00"
 period="2">
         <!-- Valid from 2018-01-24T12:00:00 to 2018-01-24T18:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-24T12:00:00 -->
         <windDirection deg="163.0" code="SSE" name="South-southeast" />
         <windSpeed mps="3.2" name="Light breeze" />
         <temperature unit="celsius" value="12" />
         <pressure unit="hPa" value="1025.8" />
       </time>
       <time from="2018-01-24T18:00:00" to="2018-01-25T00:00:00"
 period="3">
         <!-- Valid from 2018-01-24T18:00:00 to 2018-01-25T00:00:00 -->
         <symbol number="3" numberEx="3" name="Partly cloudy" var="03n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-24T18:00:00 -->
         <windDirection deg="148.3" code="SSE" name="South-southeast" />
         <windSpeed mps="3.2" name="Light breeze" />
         <temperature unit="celsius" value="9" />
         <pressure unit="hPa" value="1021.4" />
       </time>
       <time from="2018-01-25T00:00:00" to="2018-01-25T06:00:00"
 period="0">
         <!-- Valid from 2018-01-25T00:00:00 to 2018-01-25T06:00:00 -->
         <symbol number="2" numberEx="2" name="Fair" var="02n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-25T00:00:00 -->
         <windDirection deg="156.6" code="SSE" name="South-southeast" />
         <windSpeed mps="3.9" name="Gentle breeze" />
         <temperature unit="celsius" value="6" />
         <pressure unit="hPa" value="1020.6" />
       </time>
       <time from="2018-01-25T06:00:00" to="2018-01-25T12:00:00"
 period="1">
         <!-- Valid from 2018-01-25T06:00:00 to 2018-01-25T12:00:00 -->
         <symbol number="9" numberEx="46" name="Light rain" var="46" />
         <precipitation value="0.9" />
         <!-- Valid at 2018-01-25T06:00:00 -->
         <windDirection deg="155.9" code="SSE" name="South-southeast" />
         <windSpeed mps="3.9" name="Gentle breeze" />
         <temperature unit="celsius" value="4" />
         <pressure unit="hPa" value="1017.5" />
       </time>
       <time from="2018-01-25T12:00:00" to="2018-01-25T18:00:00"
 period="2">
         <!-- Valid from 2018-01-25T12:00:00 to 2018-01-25T18:00:00 -->
         <symbol number="9" numberEx="9" name="Rain" var="09" />
         <precipitation value="4.2" />
         <!-- Valid at 2018-01-25T12:00:00 -->
         <windDirection deg="156.7" code="SSE" name="South-southeast" />
         <windSpeed mps="5.2" name="Gentle breeze" />
         <temperature unit="celsius" value="8" />
         <pressure unit="hPa" value="1013.7" />
       </time>
       <time from="2018-01-25T18:00:00" to="2018-01-26T00:00:00"
 period="3">
         <!-- Valid from 2018-01-25T18:00:00 to 2018-01-26T00:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-25T18:00:00 -->
         <windDirection deg="170.6" code="S" name="South" />
         <windSpeed mps="5.1" name="Gentle breeze" />
         <temperature unit="celsius" value="11" />
         <pressure unit="hPa" value="1008.0" />
       </time>
       <time from="2018-01-26T00:00:00" to="2018-01-26T06:00:00"
 period="0">
         <!-- Valid from 2018-01-26T00:00:00 to 2018-01-26T06:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-26T00:00:00 -->
         <windDirection deg="195.2" code="SSW" name="South-southwest" />
         <windSpeed mps="4.1" name="Gentle breeze" />
         <temperature unit="celsius" value="12" />
         <pressure unit="hPa" value="1008.9" />
       </time>
       <time from="2018-01-26T06:00:00" to="2018-01-26T12:00:00"
 period="1">
         <!-- Valid from 2018-01-26T06:00:00 to 2018-01-26T12:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-26T06:00:00 -->
         <windDirection deg="179.7" code="S" name="South" />
         <windSpeed mps="3.6" name="Gentle breeze" />
         <temperature unit="celsius" value="11" />
         <pressure unit="hPa" value="1008.6" />
       </time>
       <time from="2018-01-26T12:00:00" to="2018-01-26T18:00:00"
 period="2">
         <!-- Valid from 2018-01-26T12:00:00 to 2018-01-26T18:00:00 -->
         <symbol number="5" numberEx="40" name="Light rain showers"
 var="40d" />
         <precipitation value="0.8" />
         <!-- Valid at 2018-01-26T12:00:00 -->
         <windDirection deg="188.0" code="S" name="South" />
         <windSpeed mps="4.8" name="Gentle breeze" />
         <temperature unit="celsius" value="16" />
         <pressure unit="hPa" value="1007.8" />
       </time>
       <time from="2018-01-26T18:00:00" to="2018-01-27T00:00:00"
 period="3">
         <!-- Valid from 2018-01-26T18:00:00 to 2018-01-27T00:00:00 -->
         <symbol number="9" numberEx="9" name="Rain" var="09" />
         <precipitation value="1.2" />
         <!-- Valid at 2018-01-26T18:00:00 -->
         <windDirection deg="177.5" code="S" name="South" />
         <windSpeed mps="1.9" name="Light breeze" />
         <temperature unit="celsius" value="16" />
         <pressure unit="hPa" value="1005.3" />
       </time>
       <time from="2018-01-27T00:00:00" to="2018-01-27T06:00:00"
 period="0">
         <!-- Valid from 2018-01-27T00:00:00 to 2018-01-27T06:00:00 -->
         <symbol number="10" numberEx="10" name="Heavy rain" var="10" />
         <precipitation value="5.0" />
         <!-- Valid at 2018-01-27T00:00:00 -->
         <windDirection deg="350.6" code="N" name="North" />
         <windSpeed mps="3.1" name="Light breeze" />
         <temperature unit="celsius" value="14" />
         <pressure unit="hPa" value="1007.1" />
       </time>
       <time from="2018-01-27T06:00:00" to="2018-01-27T12:00:00"
 period="1">
         <!-- Valid from 2018-01-27T06:00:00 to 2018-01-27T12:00:00 -->
         <symbol number="4" numberEx="4" name="Cloudy" var="04" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-27T06:00:00 -->
         <windDirection deg="348.4" code="NNW" name="North-northwest" />
         <windSpeed mps="6.2" name="Moderate breeze" />
         <temperature unit="celsius" value="5" />
         <pressure unit="hPa" value="1013.6" />
       </time>
       <time from="2018-01-27T12:00:00" to="2018-01-27T18:00:00"
 period="2">
         <!-- Valid from 2018-01-27T12:00:00 to 2018-01-27T18:00:00 -->
         <symbol number="2" numberEx="2" name="Fair" var="02d" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-27T12:00:00 -->
         <windDirection deg="325.1" code="NW" name="Northwest" />
         <windSpeed mps="7.3" name="Moderate breeze" />
         <temperature unit="celsius" value="2" />
         <pressure unit="hPa" value="1022.3" />
       </time>
       <time from="2018-01-27T18:00:00" to="2018-01-28T00:00:00"
 period="3">
         <!-- Valid from 2018-01-27T18:00:00 to 2018-01-28T00:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-27T18:00:00 -->
         <windDirection deg="331.4" code="NNW" name="North-northwest" />
         <windSpeed mps="6.1" name="Moderate breeze" />
         <temperature unit="celsius" value="0" />
         <pressure unit="hPa" value="1025.2" />
       </time>
       <time from="2018-01-28T00:00:00" to="2018-01-28T06:00:00"
 period="0">
         <!-- Valid from 2018-01-28T00:00:00 to 2018-01-28T06:00:00 -->
         <symbol number="1" numberEx="1" name="Clear sky" var="01n" />
         <precipitation value="0" />
         <!-- Valid at 2018-01-28T00:00:00 -->
         <windDirection deg="331.6" code="NNW" name="North-northwest" />
         <windSpeed mps="4.7" name="Gentle breeze" />
         <temperature unit="celsius" value="-4" />
         <pressure unit="hPa" value="1031.2" />
       </time>
     </tabular>
   </forecast>
 }}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13206>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list