* First implementationof Ondilo component support * Update manifest toadd pypi pkg dependency * Update entities name and corrected refresh issue * Changed percentage unit name * Corrected merge issues * Updated coveragerc * cleaned up code and corrected config flow tests * Code cleanup and added test for exisitng entry * Changes following PR comments: - Inherit CoordinatorEntity instead of Entity - Merged pools blocking calls into one - Renamed devices vars to sensors - Check supported sensor types - Stop relying on array index position for pools - Stop relying on attribute position in dict for sensors * Corrected unit test * Reformat sensor type check
32 lines
957 B
Python
32 lines
957 B
Python
"""Local implementation of OAuth2 specific to Ondilo to hard code client id and secret and return a proper name."""
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers.config_entry_oauth2_flow import LocalOAuth2Implementation
|
|
|
|
from .const import (
|
|
DOMAIN,
|
|
OAUTH2_AUTHORIZE,
|
|
OAUTH2_CLIENTID,
|
|
OAUTH2_CLIENTSECRET,
|
|
OAUTH2_TOKEN,
|
|
)
|
|
|
|
|
|
class OndiloOauth2Implementation(LocalOAuth2Implementation):
|
|
"""Local implementation of OAuth2 specific to Ondilo to hard code client id and secret and return a proper name."""
|
|
|
|
def __init__(self, hass: HomeAssistant):
|
|
"""Just init default class with default values."""
|
|
super().__init__(
|
|
hass,
|
|
DOMAIN,
|
|
OAUTH2_CLIENTID,
|
|
OAUTH2_CLIENTSECRET,
|
|
OAUTH2_AUTHORIZE,
|
|
OAUTH2_TOKEN,
|
|
)
|
|
|
|
@property
|
|
def name(self) -> str:
|
|
"""Name of the implementation."""
|
|
return "Ondilo"
|