Skip to content

Commit 4de958b

Browse files
authored
Merge pull request #15 from golles/forecast-low-and-high-temps
Fix for high temperature for forecasts
2 parents f7a1a49 + c03753f commit 4de958b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.github/ISSUE_TEMPLATE/feature_request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body:
88
label: Did you read the instructions?
99
description: Please read the instructions carefully, thank you.
1010
options:
11-
- label: I have read the [README](../blob/master/README.md).
11+
- label: I have read the [README](../blob/main/README.md), including the [known-limitations](../blob/main/README.md#known-limitations) section.
1212
required: true
1313

1414
- type: textarea

custom_components/knmi/api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ async def api_wrapper(self, method: str, url: str) -> dict:
3636
# The API has no proper error handling for a wrong API key.
3737
# Instead a 200 with a message is returned, try to detect that here.
3838
if "Vraag eerst een API-key op" in await response.text():
39-
raise KnmiApiKeyException("Invalid API key")
39+
raise KnmiApiException("Invalid API key")
4040

4141
if "Dagelijkse limiet" in await response.text():
42-
raise KnmiApiKeyException("Exceeded Daily Limit")
42+
raise KnmiApiException("Exceeded Daily Limit")
4343

4444
data = await response.json()
4545
return data.get("liveweer")[0]
@@ -63,13 +63,13 @@ async def api_wrapper(self, method: str, url: str) -> dict:
6363
url,
6464
exception,
6565
)
66-
except KnmiApiKeyException as exception:
66+
except KnmiApiException as exception:
6767
_LOGGER.error("Error in API! - %s", exception)
6868
# Raise to pass on to the user.
6969
raise exception
7070
except Exception as exception: # pylint: disable=broad-except
7171
_LOGGER.error("Something really wrong happened! - %s", exception)
7272

7373

74-
class KnmiApiKeyException(Exception):
74+
class KnmiApiException(Exception):
7575
pass

custom_components/knmi/const.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Base component constants.
2727
NAME = "KNMI"
2828
DOMAIN = "knmi"
29-
VERSION = "1.1.5"
29+
VERSION = "1.1.6"
3030
ATTRIBUTION = "KNMI Weergegevens via https://weerlive.nl/"
3131

3232
# Platforms.

custom_components/knmi/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"documentation": "https://github.com/golles/ha-knmi/",
55
"iot_class": "cloud_polling",
66
"issue_tracker": "https://github.com/golles/ha-knmi//issues",
7-
"version": "1.1.5",
7+
"version": "1.1.6",
88
"config_flow": true,
99
"codeowners": [
1010
"@golles"

custom_components/knmi/weather.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def forecast(self):
115115
else None
116116
)
117117
temp = (
118-
float(super().getData(f"d{i}tmin"))
119-
if super().getData(f"d{i}tmin") is not None
118+
float(super().getData(f"d{i}tmax"))
119+
if super().getData(f"d{i}tmax") is not None
120120
else None
121121
)
122122
precipitation = (

0 commit comments

Comments
 (0)