FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
194 stars 12 forks source link

Switch to rounded forecast values? #9

Closed hanzoh closed 4 years ago

hanzoh commented 4 years ago

This is just a feature request or more of an open discussion.

Wouldn't it look nicer in Lovelace, when the forecast temperatures are rounded? The decimals propose a precision that cannot be true anyway. For measured values and in the sensor entities, the decimals can remain so that there is a choice.

FL550 commented 4 years ago

You are right, for the forecast values a round can be a good idea. But in my location the values are relatively precise.

The actual temperature is also only the forecasted value for this hour, as I haven't found a way yet to get measured values. And this "actual" forecast temperature corresponds rather good with the temperature I measure on my own.

hanzoh commented 4 years ago

I have just tried the following modification in connector.py, lines 99-100:

                        ATTR_FORECAST_TEMP: int(round(temp_max,0)),
                        ATTR_FORECAST_TEMP_LOW: int(round(temp_min,0)),

Looks like it does what both of us want, decimal "actual" value and rounded forecasts.

image

FL550 commented 4 years ago

Thanks, I included this in v1.1.8.