mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Suppress error between 00:00 and 01:00 (#15555)
* Suppress error between 00:00 and 01:00 Suppress an error that often occers between 00:00 and 01:00 CE(S)T during that time, probably because buienradar.nl is then updating its forcast for the next day. The API does not always work between these times (in the middle of the night). * white space & import * unnecessary brackets
This commit is contained in:
parent
3acbd5a769
commit
50b6c5948d
@ -5,7 +5,7 @@ For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.buienradar/
|
||||
"""
|
||||
import asyncio
|
||||
from datetime import timedelta
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
|
||||
import async_timeout
|
||||
@ -481,9 +481,10 @@ class BrData:
|
||||
|
||||
_LOGGER.debug("Buienradar parsed data: %s", result)
|
||||
if result.get(SUCCESS) is not True:
|
||||
_LOGGER.warning("Unable to parse data from Buienradar."
|
||||
"(Msg: %s)",
|
||||
result.get(MESSAGE),)
|
||||
if int(datetime.now().strftime('%H')) > 0:
|
||||
_LOGGER.warning("Unable to parse data from Buienradar."
|
||||
"(Msg: %s)",
|
||||
result.get(MESSAGE),)
|
||||
yield from self.schedule_update(SCHEDULE_NOK)
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user