a %[obý ã@sddlZGdd„dƒZdS)éNc@s¬eZdZUeed<eed<gZgZgZeed<eed<eed<eed<eed<eed<eed <eed <d d „Z eed œdd„Z eed œdd„Z eeedœdd„Z dd„Z dS)Úweather_stationÚwindGust1minPeakSpeedÚwindGust1minPeakDirectionÚgustDataCounterÚwindDataCounterÚ windSpeedÚ windDirectionÚwind2MinAverageMPHÚwind2MinAverageDirectionÚwind10MinGustMPHÚwind10MinGustDirectioncCstdƒd|_d|_d|_dS)Nzstarting weather stationçé<éx)Úprintrrr)Úself©rúL/Users/jjulich/Documents/working/iot-expresslink/examples/weather_station.pyÚ__init__szweather_station.__init__)ÚspeedÚ directioncCs¦|jd8_||jkr$||_||_|jdkr¢d|_|j |j|jf¡d|_t|jƒdkrj|j d¡qNd}|jD]}|d|dkrt|}qt|d|_|d|_dS)Nérré )r r ) rrrÚwindGustÚappendÚlenÚpopr r )rrrZgustÚgrrrÚ_doGustss     zweather_station._doGustscCsv|jd8_||_||_|j |¡|j |¡| ||¡|jdkrrd|_tdƒ| ¡|j  ¡|j  ¡dS)NrrrZ calculate) rrrÚ windDataSpeedrÚwindDataDirectionrrÚ _calcWeatherÚclear)rrrrrrÚaddWind.s     zweather_station.addWind)Ú direction1Ú direction2ÚreturncCs0||}|dkr|dS|dkr(|dS|SdS)Ng€fÀihg€f@r)rr$r%ZdeltarrrÚ _addDirection?s zweather_station._addDirectioncCs|d}|jD] }||7}q |t|jƒ|_|jd}|jd}|jdd…D]}|| ||¡7}||7}qJ|t|jƒ|_dS)Nrr)rrr r r'r )rZ speedAverageÚwÚsumÚDÚdrrrr!Hs     zweather_station._calcWeatherN)Ú__name__Ú __module__Ú __qualname__ÚfloatÚ__annotations__rr rÚintrrr#r'r!rrrrrs$  r)ÚtimerrrrrÚs