Rudd-O / homeassistant-meteoswiss

:sun_behind_rain_cloud: :switzerland: Meteo Swiss Integration for Home Assistant (forked from websylv)
74 stars 8 forks source link

Unable to convert wind speed/temperature/pressure/... (unexpected char: "-") #13

Closed TimMayle closed 8 months ago

TimMayle commented 1 year ago

Hello,

Occasionally, an unexpected dash char ("-") is provided instead of a numerical value generating the following error: Unable to convert windSpeed value: [{'Station/Location': 'MAH', 'Date': 202304021530, 'tre200s0': '-', 'rre150z0': '-', 'sre000z0': '-', 'gre000z0': '-', 'ure200s0': '-', 'tde200s0': '-', 'dkl010z0': '-', 'fu3010z0': '-', 'fu3010z1': '-', 'prestas0': '-', 'pp0qffs0': '-', 'pp0qnhs0': '-', 'ppz850s0': '-', 'ppz700s0': '-', 'dv1towz0': '-', 'fu3towz0': '-', 'fu3towz1': '-', 'ta1tows0': '-', 'uretows0': '-', 'tdetows0': '-'}]

As we don't control what Meteoswiss provide, it might be useful to add handle this unexpected value. Should we provide the previous value?

Thank you in advance!

Tim

mbuerki84 commented 1 year ago

Hello, I have the same errors. Can you fix it?

Thank you!

Rudd-O commented 8 months ago

It should be fixed as of https://github.com/Rudd-O/homeassistant-meteoswiss/commit/529e8a2c6c3e282458d3c5c444b64d2886911124#diff-92b6dbc10d53ad393805ab2a502c2231b9677607a4a8b35b3abac7cb7c2fcd88R69 .