Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event description is not properly fetched. #9

Open
daha76 opened this issue Apr 16, 2020 · 1 comment
Open

Event description is not properly fetched. #9

daha76 opened this issue Apr 16, 2020 · 1 comment

Comments

@daha76
Copy link

daha76 commented Apr 16, 2020

Hello,

I'd like the idea to get a meteo alarm data for my home, but I found the issue with fetching event description. Used regular expression ('^(?P.?):\s(?P.*)') isn't working well and response data of my city (Kosice, Slovakia) it looks like this:

<div class="text">
  slovenčina: 
  <br>
   V okrese Košice
  <br>
  sa vo výške 5 cm nad povrchom OJEDINELE očakáva dosiahnutie minimálnej teploty vzduchu -3 - 0 °C.
  <br>
Takýto prízemný mráz predstavuje potenciálne nebezpečenstvo pre teplomilné rastliny.
  <br>
  <br> 
  <cap:instruction> 
    ZVÝŠTE POZORNOSŤ, sledujte najčerstvejšie predpovede počasia.
    <br>
    Očakávajte menšie obmedzenia aktivít vonku.
  </cap:instruction> 
  <p>
    english: 
    <br>
     No detailed description for this language. See warning details in Slovak version.
    <br>
    <br> 
    <cap:instruction> 
      BE AWARE, keep up to date with the latest weather forecast.
      <br>
      Expect some minor disruption to outdoor activities.
    </cap:instruction>
    &nbsp;
  </p>
</div>

Result will look like this:

Match 1:

lang | slovenčina
desc | <br> V okrese Košice<br>

Match 2:

lang | Takýto prízemný mráz predstavuje potenciálne nebezpečenstvo pre teplomilné rastliny.<br><br> <cap
desc | instruction>

Match 3:

lang | Očakávajte menšie obmedzenia aktivít vonku.</cap
desc | instruction> <p>

Match 4:

lang | english
desc | <br> No detailed description for this language. See warning details in Slovak version.<br><br> <cap:instruction>

Match 5:

lang | Expect some minor disruption to outdoor activities.</cap
desc | instruction>&nbsp;</p>

and the result is quite incomplete and sensor returns incomplete data like this:

attribution: Data provided by meteoalarm.eu
location: košice
today: []
tomorrow:
  - event: Extreme low temperature
    code: Yellow
    start: '17.04.2020 01:00 CEST'
    end: '17.04.2020 07:00 CEST'
    slovenčina: V okrese Košice
    english: >-
      No detailed description for this language. See warning details in Slovak
      version.  
unit_of_measurement: events
friendly_name: weather_alert
icon: 'mdi:weather-lightning-rainy'

Would it be possible to improve description parsing?

@kodi1
Copy link
Owner

kodi1 commented Jun 12, 2020

PR is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants