refactor(data_coordinators): rename

This commit is contained in:
Brian Berg 2020-07-11 16:17:02 +00:00
parent 92bd188ea9
commit 24488a8eb7
2 changed files with 6 additions and 6 deletions

View File

@ -26,8 +26,8 @@ from .const import (
)
from .nicehash import NiceHashPrivateClient
from .data_coordinators import (
NiceHashAccountsDataUpdateCoordinator,
NiceHashMiningRigsDataUpdateCoordinator,
AccountsDataUpdateCoordinator,
MiningRigsDataUpdateCoordinator,
)
_LOGGER = logging.getLogger(__name__)
@ -67,7 +67,7 @@ async def async_setup(hass: HomeAssistant, config: Config):
client = NiceHashPrivateClient(organization_id, api_key, api_secret)
accounts_coordinator = NiceHashAccountsDataUpdateCoordinator(hass, client)
accounts_coordinator = AccountsDataUpdateCoordinator(hass, client)
await accounts_coordinator.async_refresh()
@ -81,7 +81,7 @@ async def async_setup(hass: HomeAssistant, config: Config):
hass.data[DOMAIN]["accounts_coordinator"] = accounts_coordinator
if rigs_enabled or devices_enabled:
rigs_coordinator = NiceHashMiningRigsDataUpdateCoordinator(hass, client)
rigs_coordinator = MiningRigsDataUpdateCoordinator(hass, client)
await rigs_coordinator.async_refresh()
if not rigs_coordinator.last_update_success:

View File

@ -22,7 +22,7 @@ SCAN_INTERVAL_ACCOUNTS = timedelta(minutes=60)
_LOGGER = logging.getLogger(__name__)
class NiceHashAccountsDataUpdateCoordinator(DataUpdateCoordinator):
class AccountsDataUpdateCoordinator(DataUpdateCoordinator):
"""Manages fetching accounts data from NiceHash API"""
def __init__(self, hass: HomeAssistant, client: NiceHashPrivateClient):
@ -55,7 +55,7 @@ class NiceHashAccountsDataUpdateCoordinator(DataUpdateCoordinator):
raise UpdateFailed(e)
class NiceHashMiningRigsDataUpdateCoordinator(DataUpdateCoordinator):
class MiningRigsDataUpdateCoordinator(DataUpdateCoordinator):
"""Manages fetching mining rigs data from NiceHash API"""
def __init__(self, hass: HomeAssistant, client: NiceHashPrivateClient):