Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from rccoleman/dev
Browse files Browse the repository at this point in the history
Remove the need for the authlib requirement
  • Loading branch information
rccoleman authored Nov 29, 2020
2 parents 80c6363 + e6ee5a2 commit b5e2d2e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
14 changes: 10 additions & 4 deletions custom_components/lamarzocco/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
"""The La Marzocco integration."""
import asyncio
from authlib.integrations.requests_client import OAuth2Session

# from authlib.integrations.requests_client import OAuth2Session
from requests import Response
from requests_oauthlib import OAuth2Session


from homeassistant.config_entries import ConfigEntry
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.core import HomeAssistant
from datetime import timedelta
import logging
import oauthlib

from homeassistant.const import (
CONF_USERNAME,
Expand Down Expand Up @@ -123,12 +129,12 @@ def init_data(self):
self.config_endpoint = f"{GW_URL}/{serial_number}/configuration"
self.status_endpoint = f"{GW_URL}/{serial_number}/status"
self.client = OAuth2Session(
self._config[CONF_CLIENT_ID],
self._config[CONF_CLIENT_SECRET],
token_endpoint=token_endpoint,
client=oauthlib.oauth2.LegacyApplicationClient(self._config[CONF_CLIENT_ID])
)

self.client.fetch_token(
token_endpoint,
client_secret=self._config[CONF_CLIENT_SECRET],
username=self._config[CONF_USERNAME],
password=self._config[CONF_PASSWORD],
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/lamarzocco/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "La Marzocco",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/lamarzocco",
"requirements": ["authlib"],
"requirements": [],
"ssdp": [],
"zeroconf": [],
"homekit": {},
Expand Down
1 change: 0 additions & 1 deletion custom_components/lamarzocco/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
DEFAULT_NAME,
ATTR_MAP,
)
from homeassistant.const import CONF_NAME

_LOGGER = logging.getLogger(__name__)

Expand Down

0 comments on commit b5e2d2e

Please sign in to comment.