From 45b94b2faffc3cae69390bb58a7650665ea9f7b1 Mon Sep 17 00:00:00 2001 From: Pascal Bourque Date: Sun, 3 Nov 2024 13:39:17 -0500 Subject: [PATCH] feat: Display wind consistency label for the past 24 hours (#26) --- messages/en.json | 3 +- messages/fr.json | 3 +- public/sample_data/current.json | 609 ++++++++++++---------- public/sample_data/global.json | 2 +- src/app/page.tsx | 4 +- weewx/skins/me.teo/data/current.json.tmpl | 11 + weewx/skins/me.teo/lang/en.conf | 6 + weewx/skins/me.teo/lang/fr.conf | 6 + 8 files changed, 375 insertions(+), 269 deletions(-) diff --git a/messages/en.json b/messages/en.json index c73943c..774f709 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,8 +1,7 @@ { "Global": { "DataLoadErrorTitle": "Unable to load weather data.", - "DataLoadUnexpectedErrorMessage": "An unexpected error occurred while loading weather data.", - "DominantWindDirectionLabel": "dominant" + "DataLoadUnexpectedErrorMessage": "An unexpected error occurred while loading weather data." }, "Current": { "PageTitle": "Current Conditions", diff --git a/messages/fr.json b/messages/fr.json index 54b6561..3f89d0e 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -1,8 +1,7 @@ { "Global": { "DataLoadErrorTitle": "Impossible de charger les données.", - "DataLoadUnexpectedErrorMessage": "Une erreur inattendue s'est produite lors du chargement des données.", - "DominantWindDirectionLabel": "dominant" + "DataLoadUnexpectedErrorMessage": "Une erreur inattendue s'est produite lors du chargement des données." }, "Current": { "PageTitle": "Conditions actuelles", diff --git a/public/sample_data/current.json b/public/sample_data/current.json index 83c9205..2b194d5 100644 --- a/public/sample_data/current.json +++ b/public/sample_data/current.json @@ -1,322 +1,409 @@ { "report": { - "time": 1730317200 + "time": 1730658600 }, "observations": [ { "observation": "outTemp", - "label": "Outside Temperature", + "label": "Température extérieure", "unit": "°C", - "current": 19.310000000000006, - "min": 8.362, - "minTime": 1730262300, - "max": 19.45000000000001, - "maxTime": 1730316300, + "current": 5.576, + "min": -3.393999999999999, + "minTime": 1730632800, + "max": 5.758000000000002, + "maxTime": 1730658300, "past24h": [ - [1730230800, 12.60866666666667], - [1730234400, 11.894194444444446], - [1730238000, 10.292972222222216], - [1730241600, 9.42797222222222], - [1730245200, 9.466083333333334], - [1730248800, 10.041125], - [1730252400, 10.0225], - [1730256000, 9.51316666666667], - [1730259600, 8.523], - [1730263200, 8.710166666666666], - [1730266800, 9.881166666666665], - [1730270400, 10.689166666666669], - [1730274000, 11.153875000000003], - [1730277600, 11.48633333333333], - [1730281200, 11.899583333333332], - [1730284800, 12.303555555555555], - [1730288400, 12.79416666666667], - [1730292000, 13.474166666666667], - [1730295600, 14.3455], - [1730299200, 15.351791666666667], - [1730302800, 16.359791666666663], - [1730306400, 17.149333333333335], - [1730310000, 18.13058333333333], - [1730313600, 19.096] + [1730568600, 4.285375000000001], + [1730572200, 4.391208333333334], + [1730575800, 4.265], + [1730579400, 3.624374999999998], + [1730583000, 3.0130000000000003], + [1730586600, 2.7738333333333327], + [1730590200, 2.2136666666666667], + [1730593800, 0.8423750000000001], + [1730597400, -0.38822222222222336], + [1730601000, -0.8823333333333336], + [1730604600, -1.6268333333333354], + [1730608200, -2.2179722222222233], + [1730611800, -2.0865833333333326], + [1730619000, -2.5802500000000013], + [1730622600, -2.5845000000000002], + [1730626200, -2.4201666666666672], + [1730629800, -3.0946666666666682], + [1730633400, -3.019666666666667], + [1730637000, -0.08599999999999891], + [1730640600, 1.3023333333333338], + [1730644200, 2.3314583333333356], + [1730647800, 3.2771666666666652], + [1730651400, 4.1474583333333355], + [1730655000, 5.351416666666668] + ] + }, + { + "observation": "appTemp", + "label": "Température ressentie", + "unit": "°C", + "current": 2.0990031479733733, + "min": -6.18662707949125, + "minTime": 1730632800, + "max": 2.5252064761394837, + "maxTime": 1730658300, + "past24h": [ + [1730568600, 1.2356921587856935], + [1730572200, 1.0927146018555294], + [1730575800, 1.1080597356255555], + [1730579400, 0.4281246279887638], + [1730583000, 0.4424596252540485], + [1730586600, 0.38681123665060035], + [1730590200, -0.21036321267951014], + [1730593800, -1.6755384171594951], + [1730597400, -3.0279349615362783], + [1730601000, -3.542987752599118], + [1730604600, -4.214335603498416], + [1730608200, -4.912190706218287], + [1730611800, -4.865558982954005], + [1730619000, -5.350881958859433], + [1730622600, -5.525649320776696], + [1730626200, -5.291493907152431], + [1730629800, -5.889685290651712], + [1730633400, -5.854352107311995], + [1730637000, -2.8001691388218495], + [1730640600, -1.6397808887597263], + [1730644200, -0.6622136629237849], + [1730647800, 0.06447606734255767], + [1730651400, 0.967890634714246], + [1730655000, 2.048476328780341] ] }, { "observation": "outHumidity", - "label": "Outside Humidity", + "label": "Humidité extérieure", "unit": "%", - "current": 73.84, - "min": 68.912, - "minTime": 1730232000, - "max": 99.834, - "maxTime": 1730260800, + "current": 51.762, + "min": 51.42999999999999, + "minTime": 1730658300, + "max": 92.35799999999999, + "maxTime": 1730632800, "past24h": [ - [1730230800, 69.92483333333332], - [1730234400, 73.21045833333334], - [1730238000, 75.43525], - [1730241600, 75.68545833333333], - [1730245200, 75.598875], - [1730248800, 74.82183333333333], - [1730252400, 85.003], - [1730256000, 98.17649999999999], - [1730259600, 99.28666666666668], - [1730263200, 99.0], - [1730266800, 99.01566666666668], - [1730270400, 99.40633333333334], - [1730274000, 98.12004166666667], - [1730277600, 96.37745833333334], - [1730281200, 95.23554166666666], - [1730284800, 94.54668055555555], - [1730288400, 93.70116666666667], - [1730292000, 91.8385], - [1730295600, 89.73316666666666], - [1730299200, 86.61658333333332], - [1730302800, 83.23245833333333], - [1730306400, 80.81529166666667], - [1730310000, 77.84245833333334], - [1730313600, 74.7325] + [1730568600, 61.80508333333333], + [1730572200, 59.65295833333334], + [1730575800, 59.41683333333333], + [1730579400, 60.8975], + [1730583000, 63.50749999999999], + [1730586600, 67.00716666666666], + [1730590200, 72.0275], + [1730593800, 76.72604166666666], + [1730597400, 81.77805555555555], + [1730601000, 82.51429166666667], + [1730604600, 86.18025], + [1730608200, 88.53930555555554], + [1730611800, 88.49941666666666], + [1730619000, 90.40570833333334], + [1730622600, 89.41633333333334], + [1730626200, 87.70383333333332], + [1730629800, 91.131625], + [1730633400, 90.50416666666666], + [1730637000, 78.43133333333334], + [1730640600, 72.94383333333333], + [1730644200, 66.36125], + [1730647800, 61.874], + [1730651400, 58.050847222222224], + [1730655000, 53.11545833333333] ] }, { "observation": "windDir", - "label": "Wind Direction", + "label": "Direction du vent", "unit": "°", - "current": 179.49049833847496, - "currentCompass": "S", - "max": 166.96039445696627, - "maxCompass": "SSE", + "current": 342.1244301291463, + "currentCompass": "NNO", + "max": 288.3041554459179, + "maxCompass": "ONO", + "maxLabel": "généralement", "past24h": [ - [1730230800, 160.30124554256795], - [1730234400, 143.54134379855478], - [1730238000, 139.43734581409066], - [1730241600, 150.21345507277275], - [1730245200, 147.7349016592312], - [1730248800, 147.60790639046962], - [1730252400, 148.5580493376819], - [1730256000, 150.11867337760364], - [1730259600, 145.0934895643724], - [1730263200, 151.5207603704474], - [1730266800, 157.34388353569628], - [1730270400, 158.836477654891], - [1730274000, 160.68403342932694], - [1730277600, 165.04795785660977], - [1730281200, 170.31318536244746], - [1730284800, 175.75081396769232], - [1730288400, 181.12725758073157], - [1730292000, 186.90124668407967], - [1730295600, 188.46036371250864], - [1730299200, 190.0317494643995], - [1730302800, 192.64108585476183], - [1730306400, 189.27257682232312], - [1730310000, 174.86878235734136], - [1730313600, 176.0783777948634] + [1730568600, 327.1764124467873], + [1730572200, 320.0922196782481], + [1730575800, 315.165130652485], + [1730579400, 312.7062700865437], + [1730583000, 283.28516673924554], + [1730586600, 220.0359269132115], + [1730590200, 274.19309394105784], + [1730593800, 260.93900117693613], + [1730597400, 243.48174358702383], + [1730601000, 265.6306392582231], + [1730604600, 279.16142772585766], + [1730608200, 261.78678912967274], + [1730611800, 249.2464047077625], + [1730619000, 244.4304432604297], + [1730622600, 257.40618797946087], + [1730626200, 243.42651583027654], + [1730629800, 231.56658437287118], + [1730633400, 232.87378161687778], + [1730637000, 272.89206399763805], + [1730640600, 215.73459588930305], + [1730644200, 209.99478335675008], + [1730647800, 292.9421357246405], + [1730651400, 260.91891223766794], + [1730655000, 290.6438147714684] ] }, { "observation": "windSpeed", - "label": "Wind Speed", + "label": "Vitesse du vent", "unit": " km/h", - "current": 5.968014833409971, - "min": 2.6429499652382975, - "minTime": 1730239500, - "max": 11.113902623435697, - "maxTime": 1730304300, + "current": 5.277831299787491, + "min": 0.0, + "minTime": 1730585100, + "max": 7.590978867262358, + "maxTime": 1730572800, "past24h": [ - [1730230800, 5.286492700386301], - [1730234400, 4.957404853876128], - [1730238000, 3.471893330727824], - [1730241600, 6.430812122792407], - [1730245200, 7.456105062925681], - [1730248800, 6.417316067814878], - [1730252400, 5.674749678483577], - [1730256000, 5.934028661343503], - [1730259600, 6.235546045234362], - [1730263200, 6.675982772456352], - [1730266800, 5.283186652597576], - [1730270400, 5.878000443428707], - [1730274000, 6.597917377750192], - [1730277600, 7.150127568630876], - [1730281200, 7.513806958680023], - [1730284800, 6.665848147932425], - [1730288400, 6.999665988627762], - [1730292000, 8.402637118565163], - [1730295600, 9.153348459235712], - [1730299200, 9.050116739987319], - [1730302800, 7.963647713127912], - [1730306400, 7.469723511055889], - [1730310000, 5.859018878326623], - [1730313600, 6.128770660993012] + [1730568600, 3.806397796919917], + [1730572200, 4.845841409402375], + [1730575800, 4.011027903933008], + [1730579400, 4.044904510667521], + [1730583000, 0.8155915008244635], + [1730586600, 0.17633803227045583], + [1730590200, 0.6476542413136998], + [1730593800, 0.8211979057365412], + [1730597400, 1.240986167158984], + [1730601000, 1.1284008907476293], + [1730604600, 0.6622877363316453], + [1730608200, 1.080766721316944], + [1730611800, 1.5893176834215232], + [1730619000, 1.42729903625182], + [1730622600, 2.2168453595594366], + [1730626200, 1.803067639391892], + [1730629800, 1.321141151071971], + [1730633400, 1.514892226780018], + [1730637000, 1.4561675420591405], + [1730640600, 2.860452432812005], + [1730644200, 2.9504692555970022], + [1730647800, 4.058110982483487], + [1730651400, 3.866321210087503], + [1730655000, 4.462942687217587] ] }, { "observation": "windGust", - "label": "Gust Speed", + "label": "Vitesse des rafales", "unit": " km/h", - "current": 14.364035701591957, - "min": 6.588016374414357, - "minTime": 1730238600, - "max": 24.66006129220675, - "maxTime": 1730299500, + "current": 12.240030422409188, + "min": 0.0, + "minTime": 1730585100, + "max": 14.076034985770566, + "maxTime": 1730572800, "past24h": [ - [1730230800, 13.845034411622157], - [1730234400, 12.25203045223508], - [1730238000, 10.125025165595835], - [1730241600, 14.652036417413353], - [1730245200, 15.807039288155392], - [1730248800, 13.953034680055179], - [1730252400, 14.052034926118782], - [1730256000, 13.638033897125533], - [1730259600, 14.559036186262693], - [1730263200, 14.931037110865326], - [1730266800, 12.93003213739794], - [1730270400, 12.72903163781426], - [1730274000, 14.625036350305097], - [1730277600, 13.914034583121031], - [1730281200, 14.76603670075932], - [1730284800, 13.125032622068677], - [1730288400, 13.896034538382194], - [1730292000, 16.461040913666473], - [1730295600, 16.1490401381933], - [1730299200, 18.822046781910597], - [1730302800, 16.30204051847341], - [1730306400, 15.798039265785976], - [1730310000, 13.119032607155729], - [1730313600, 13.683034008972623] + [1730568600, 7.4880186113562095], + [1730572200, 9.624023920364873], + [1730575800, 8.934022205376118], + [1730579400, 7.2570180372078], + [1730583000, 1.9500048467073463], + [1730586600, 1.1880029527632447], + [1730590200, 1.9050047348602535], + [1730593800, 2.2740056520064127], + [1730597400, 2.3790059129829624], + [1730601000, 2.640006561696099], + [1730604600, 2.100005219530988], + [1730608200, 2.51400624852424], + [1730611800, 2.85750710229038], + [1730619000, 2.871007135844508], + [1730622600, 3.618008992506245], + [1730626200, 3.405008463096673], + [1730629800, 2.7630068674114856], + [1730633400, 3.165007866578846], + [1730637000, 4.029010014043024], + [1730640600, 6.531016232741373], + [1730644200, 6.906017164800478], + [1730647800, 8.964022279940846], + [1730651400, 9.861024509426226], + [1730655000, 9.438023458063554] ] }, { "observation": "rainRate", - "label": "Rain Rate", + "label": "Taux de précipitations", "unit": " mm/h", "current": 0.0, - "max": 6.1471212692307695, - "maxTime": 1730257500, + "max": 0.0, + "maxTime": 1730568900, "past24h": [ - [1730230800, 0.0], - [1730234400, 0.0], - [1730238000, 0.0], - [1730241600, 0.0], - [1730245200, 0.0], - [1730248800, 0.0], - [1730252400, 5.482149561904772], - [1730256000, 6.1471212692307695], - [1730259600, 0.6619480776699028], - [1730263200, 1.1640164799999997], - [1730266800, 0.03196800000000005], - [1730270400, 0.0], - [1730274000, 0.0], - [1730277600, 0.0], - [1730281200, 0.0], - [1730284800, 0.0], - [1730288400, 0.0], - [1730292000, 0.0], - [1730295600, 0.0], - [1730299200, 0.0], - [1730302800, 0.0], - [1730306400, 0.0], - [1730310000, 0.0], - [1730313600, 0.0] + [1730568600, 0.0], + [1730572200, 0.0], + [1730575800, 0.0], + [1730579400, 0.0], + [1730583000, 0.0], + [1730586600, 0.0], + [1730590200, 0.0], + [1730593800, 0.0], + [1730597400, 0.0], + [1730601000, 0.0], + [1730604600, 0.0], + [1730608200, 0.0], + [1730611800, 0.0], + [1730619000, 0.0], + [1730622600, 0.0], + [1730626200, 0.0], + [1730629800, 0.0], + [1730633400, 0.0], + [1730637000, 0.0], + [1730640600, 0.0], + [1730644200, 0.0], + [1730647800, 0.0], + [1730651400, 0.0], + [1730655000, 0.0] ] }, { "observation": "rain", - "label": "Rain", + "label": "Précipitations", "unit": " mm", "current": 0.0, - "sum": 6.503843, + "sum": 0.0, "past24h": [ - [1730230800, 0.0], - [1730234400, 0.0], - [1730238000, 0.0], - [1730241600, 0.0], - [1730245200, 0.0], - [1730248800, 0.0], - [1730252400, 2.5679009999999995], - [1730256000, 3.338972], - [1730259600, 0.39488300000000004], - [1730263200, 0.19409500000000002], - [1730266800, 0.007992], - [1730270400, 0.0], - [1730274000, 0.0], - [1730277600, 0.0], - [1730281200, 0.0], - [1730284800, 0.0], - [1730288400, 0.0], - [1730292000, 0.0], - [1730295600, 0.0], - [1730299200, 0.0], - [1730302800, 0.0], - [1730306400, 0.0], - [1730310000, 0.0], - [1730313600, 0.0] + [1730568600, 0.0], + [1730572200, 0.0], + [1730575800, 0.0], + [1730579400, 0.0], + [1730583000, 0.0], + [1730586600, 0.0], + [1730590200, 0.0], + [1730593800, 0.0], + [1730597400, 0.0], + [1730601000, 0.0], + [1730604600, 0.0], + [1730608200, 0.0], + [1730611800, 0.0], + [1730619000, 0.0], + [1730622600, 0.0], + [1730626200, 0.0], + [1730629800, 0.0], + [1730633400, 0.0], + [1730637000, 0.0], + [1730640600, 0.0], + [1730644200, 0.0], + [1730647800, 0.0], + [1730651400, 0.0], + [1730655000, 0.0] ] }, { "observation": "barometer", - "label": "Barometer", + "label": "Baromètre", "unit": " mbar", - "current": 1014.3302717574509, - "min": 1014.3112741359657, - "minTime": 1730316600, - "max": 1024.3973202351565, - "maxTime": 1730231100, + "current": 1032.1263949908755, + "min": 1027.0878172095054, + "minTime": 1730574600, + "max": 1033.657777913971, + "maxTime": 1730644200, "past24h": [ - [1730230800, 1024.0085659781057], - [1730234400, 1023.6342294006589], - [1730238000, 1023.7374479883279], - [1730241600, 1023.7814768407719], - [1730245200, 1023.3567592827246], - [1730248800, 1023.5129929334942], - [1730252400, 1023.4637569346347], - [1730256000, 1022.9456790604243], - [1730259600, 1022.3460569879826], - [1730263200, 1021.7399705657313], - [1730266800, 1021.3969018712974], - [1730270400, 1020.8490509380234], - [1730274000, 1020.3650921572024], - [1730277600, 1019.9444916041506], - [1730281200, 1019.7019898178958], - [1730284800, 1019.2320214785558], - [1730288400, 1019.1193840232529], - [1730292000, 1019.2237918931776], - [1730295600, 1018.7648573747217], - [1730299200, 1018.064138171748], - [1730302800, 1017.2327686727035], - [1730306400, 1016.2340902242938], - [1730310000, 1015.3076416086025], - [1730313600, 1014.5690366162182] + [1730568600, 1027.2673874741445], + [1730572200, 1027.143149983031], + [1730575800, 1027.4174976345682], + [1730579400, 1027.8124939969887], + [1730583000, 1028.251160398524], + [1730586600, 1028.6143857517172], + [1730590200, 1029.062523150859], + [1730593800, 1029.295692877333], + [1730597400, 1029.4423348949001], + [1730601000, 1029.5734924458764], + [1730604600, 1029.840240621553], + [1730608200, 1030.0766911038938], + [1730611800, 1030.4087384940392], + [1730619000, 1030.8474838464483], + [1730622600, 1031.4554063413177], + [1730626200, 1031.8387197441525], + [1730629800, 1032.0224321340468], + [1730633400, 1032.6036810540324], + [1730637000, 1033.2857754619852], + [1730640600, 1033.592085730527], + [1730644200, 1033.1893819940985], + [1730647800, 1032.955386601204], + [1730651400, 1032.757809413956], + [1730655000, 1032.3807721002065] ] }, + { + "observation": "lightning_strike_count", + "label": "Nombre d’éclairs", + "unit": "", + "current": 0, + "past24h": [] + }, + { + "observation": "lightning_distance", + "label": "Distance des éclair", + "unit": " km", + "current": 0, + "past24h": [] + }, { "observation": "UV", - "label": "UV Index", + "label": "Indice UV", "unit": "", - "current": 0.8380000000000001, - "max": 1.718, - "maxTime": 1730306700, + "current": 1.652, + "max": 2.17, + "maxTime": 1730652000, + "past24h": [ + [1730568600, 0.6975], + [1730572200, 0.682], + [1730575800, 0.5199999999999999], + [1730579400, 0.25], + [1730583000, 0.032], + [1730586600, 0.0], + [1730590200, 0.0], + [1730593800, 0.0], + [1730597400, 0.0], + [1730601000, 0.0], + [1730604600, 0.0], + [1730608200, 0.0], + [1730611800, 0.0], + [1730619000, 0.0], + [1730622600, 0.0], + [1730626200, 0.0], + [1730629800, 0.004], + [1730633400, 0.30000000000000004], + [1730637000, 0.8220000000000001], + [1730640600, 1.616], + [1730644200, 2.008], + [1730647800, 2.144], + [1730651400, 2.17], + [1730655000, 2.026] + ] + }, + { + "observation": "consBatteryVoltage", + "label": "Batterie de la station", + "unit": " V", + "current": 2.749, + "min": 2.613, + "minTime": 1730630400, + "max": 2.756, + "maxTime": 1730640900, "past24h": [ - [1730230800, 0.8800000000000001], - [1730234400, 0.22400000000000003], - [1730238000, 0.015999999999999997], - [1730241600, 0.0], - [1730245200, 0.0], - [1730248800, 0.0], - [1730252400, 0.0], - [1730256000, 0.0], - [1730259600, 0.0], - [1730263200, 0.0], - [1730266800, 0.0], - [1730270400, 0.0], - [1730274000, 0.0], - [1730277600, 0.0], - [1730281200, 0.0], - [1730284800, 0.01], - [1730288400, 0.21400000000000002], - [1730292000, 0.8019999999999999], - [1730295600, 1.012], - [1730299200, 1.2479999999999998], - [1730302800, 1.6619999999999997], - [1730306400, 1.718], - [1730310000, 1.3800000000000001], - [1730313600, 1.4220000000000002] + [1730568600, 2.629], + [1730572200, 2.627333333333333], + [1730575800, 2.6253333333333333], + [1730579400, 2.6245], + [1730583000, 2.624], + [1730586600, 2.6240833333333335], + [1730590200, 2.623416666666667], + [1730593800, 2.6235833333333334], + [1730597400, 2.623666666666667], + [1730601000, 2.622], + [1730604600, 2.6213333333333333], + [1730608200, 2.621583333333333], + [1730611800, 2.6194166666666665], + [1730619000, 2.618], + [1730622600, 2.61775], + [1730626200, 2.617], + [1730629800, 2.6164166666666664], + [1730633400, 2.623083333333333], + [1730637000, 2.7133333333333334], + [1730640600, 2.751583333333333], + [1730644200, 2.750833333333333], + [1730647800, 2.749833333333333], + [1730651400, 2.749916666666667], + [1730655000, 2.7495833333333333] ] }, null diff --git a/public/sample_data/global.json b/public/sample_data/global.json index ea24c5d..dd0b447 100644 --- a/public/sample_data/global.json +++ b/public/sample_data/global.json @@ -8,7 +8,7 @@ }, "meta": { "generator": "weewx 5.1.0", - "skin": "me.teo 0.1.0", + "skin": "me.teo ", "lang": "fr", "googleAnalyticsId": "" } diff --git a/src/app/page.tsx b/src/app/page.tsx index 5244c35..2047036 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -81,9 +81,7 @@ export default function Home() { minTimestamp={observation.minTime} maxValue={observation.max} formattedMaxValue={observation.observation === 'windDir' ? observation.maxCompass : undefined} - maxTimestamp={ - observation.observation === 'windDir' ? t('Global.DominantWindDirectionLabel') : observation.maxTime - } + maxTimestamp={observation.maxLabel ?? observation.maxTime} sumValue={observation.sum} sparkLineData={observation.past24h} sparkLinePlotType={plotTypeFromObservation(observation.observation)} diff --git a/weewx/skins/me.teo/data/current.json.tmpl b/weewx/skins/me.teo/data/current.json.tmpl index e6d3de2..c8a8277 100644 --- a/weewx/skins/me.teo/data/current.json.tmpl +++ b/weewx/skins/me.teo/data/current.json.tmpl @@ -30,9 +30,20 @@ "unit": "$getVar('unit.label.' + $x)", "current": $getVar('current.' + $x).json, #if $x == 'windDir' + #set $wind_vecavg = $span(hour_delta=24).wind.vecavg.raw + #set $wind_avg = $span(hour_delta=24).windSpeed.avg.raw + #set $steadiness = $wind_vecavg / $wind_avg if $wind_avg > 0 else 0 + #if $steadiness > 0.75 + #set $consistency = $gettext("steady") + #elif $steadiness > 0.5 + #set $consistency = $gettext("mainly") + #else + #set $consistency = $gettext("variable") + #end if "currentCompass": "$current.windDir.ordinal_compass", "max": $span(hour_delta=24).wind.vecdir.json, "maxCompass": "$span(hour_delta=24).wind.vecdir.ordinal_compass", + "maxLabel": "$consistency", "past24h": $span(hour_delta=24).windDir.series(aggregate_type='avg', aggregate_interval='1h', time_series='start').json #elif $x in $obs_type_sum "sum": $getattr($span(hour_delta=24), $x).sum.json, diff --git a/weewx/skins/me.teo/lang/en.conf b/weewx/skins/me.teo/lang/en.conf index a967bf6..c4f6c97 100644 --- a/weewx/skins/me.teo/lang/en.conf +++ b/weewx/skins/me.teo/lang/en.conf @@ -131,3 +131,9 @@ unit_system = us signal6 = Signal6 signal7 = Signal7 signal8 = Signal8 + +[Texts] + + "steady" = "steady" + "mainly" = "mainly" + "variable" = "variable" diff --git a/weewx/skins/me.teo/lang/fr.conf b/weewx/skins/me.teo/lang/fr.conf index 13750e2..7500c14 100644 --- a/weewx/skins/me.teo/lang/fr.conf +++ b/weewx/skins/me.teo/lang/fr.conf @@ -131,3 +131,9 @@ unit_system = metricwx signal6 = Signal6 signal7 = Signal7 signal8 = Signal8 + +[Texts] + + "steady" = "stable" + "mainly" = "généralement" + "variable" = "variable"