Improve sense timeout exception handling (#33127)

asyncio.Timeout needs to be trapped as well
This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-03-22 21:41:59 -07:00
1 parent 0b2a8bf79a
commit fa60e9b03b
4 files changed
+14 -11

No files matched your search

+7
View File
@@ -1,4 +1,9 @@
"""Constants for monitoring a Sense energy sensor."""
import asyncio
from sense_energy import SenseAPITimeoutException
DOMAIN = "sense"
DEFAULT_TIMEOUT = 10
ACTIVE_UPDATE_RATE = 60
@@ -18,6 +23,8 @@ PRODUCTION_ID = "production"
ICON = "mdi:flash"
SENSE_TIMEOUT_EXCEPTIONS = (asyncio.TimeoutError, SenseAPITimeoutException)
MDI_ICONS = {
"ac": "air-conditioner",
"aquarium": "fish",