smart_meter_texas/__init__.py
async def request(
        self,
        path: str,
        method: str = "post",
        **kwargs,
    ):
        """Helper method to make API calls against the SMT API."""
        await self.authenticate()
        resp = await self.websession.request(
            method,
            f"{BASE_ENDPOINT}{path}",
            headers=self.headers,
            **kwargs,
            ssl=self.ssl_context,
        )
        if resp.status == 401:
            _LOGGER.debug("Authentication token expired; requesting new token")
            self.authenticated = False
            await self.authenticate()
            raise SmartMeterTexasAuthExpired

        # Since API call did not return a 400 code, update the token_expiration.
        self._update_token_expiration()

        json_response = await resp.json()
        return json_response
Helper method to make API calls against the SMT API.
Helper method to make API calls against the SMT API.
Helper method to make API calls against the SMT API .
async def request(
        self,
        path: str,
        method: str = "post",
        **kwargs,
    ):
        await self.authenticate()
        resp = await self.websession.request(
            method,
            f"{BASE_ENDPOINT}{path}",
            headers=self.headers,
            **kwargs,
            ssl=self.ssl_context,
        )
        if resp.status == 401:
            _LOGGER.debug("Authentication token expired; requesting new token")
            self.authenticated = False
            await self.authenticate()
            raise SmartMeterTexasAuthExpired
        self._update_token_expiration()
        json_response = await resp.json()
        return json_response
async def request ( self , path : str , method : str = "post" , ** kwargs , ) : await self . authenticate ( ) resp = await self . websession . request ( method , f"{BASE_ENDPOINT}{path}" , headers = self . headers , ** kwargs , ssl = self . ssl_context , ) if resp . status == 401 : _LOGGER . debug ( "Authentication token expired; requesting new token" ) self . authenticated = False await self . authenticate ( ) raise SmartMeterTexasAuthExpired self . _update_token_expiration ( ) json_response = await resp . json ( ) return json_response
Helper method to make API calls against the SMT API.
Helper method to make API calls against the SMT API .
"""Helper method to make API calls against the SMT API.""" # Since API call did not return a 400 code, update the token_expiration.
self
path
str
method
str