Skip to content

Commit

Permalink
refactor: move poll interval to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Dec 29, 2022
1 parent 1aed3fa commit 0b947e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions custom_components/nexa_bridge_x/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

DOMAIN = "nexa_bridge_x"

POLL_INTERVAL = 10

NODE_SENSOR_CAPABILITIES = [
"switchLevel",
"meter",
Expand Down
7 changes: 5 additions & 2 deletions custom_components/nexa_bridge_x/nexa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
DataUpdateCoordinator,
UpdateFailed,
)
from .const import NODE_SENSOR_CAPABILITIES
from .const import (
NODE_SENSOR_CAPABILITIES,
POLL_INTERVAL
)
import asyncio
import aiohttp
import json
Expand Down Expand Up @@ -214,7 +217,7 @@ def __init__(self, hass, api):
hass,
_LOGGER,
name="Nexa Bridge X Coordinator",
update_interval=timedelta(seconds=10),
update_interval=timedelta(seconds=POLL_INTERVAL),
)
self.api = api

Expand Down

0 comments on commit 0b947e7

Please sign in to comment.