From 1cc032ce2af25d549707d09b3c111b9ae7730bc3 Mon Sep 17 00:00:00 2001 From: njobrien1006 <59174199+njobrien1006@users.noreply.github.com> Date: Wed, 29 Dec 2021 06:35:17 -0600 Subject: [PATCH] Update traeger.py -Re-add grill message debug. -Fix loop=loop per HA warning. --- custom_components/traeger/traeger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/traeger/traeger.py b/custom_components/traeger/traeger.py index ede016f..29958f0 100644 --- a/custom_components/traeger/traeger.py +++ b/custom_components/traeger/traeger.py @@ -196,7 +196,8 @@ async def get_mqtt_client(self, on_connect, on_message, on_log, on_subscribe): return self.mqtt_client def grill_message(self, client, userdata, message): - _LOGGER.debug(f"Token Time Remaining:{self.token_remaining()} MQTT Time Remaining:{self.mqtt_url_remaining()}") + _LOGGER.debug("grill_message: message.topic = %s, message.payload = %s", message.topic, message.payload) + _LOGGER.info(f"Token Time Remaining:{self.token_remaining()} MQTT Time Remaining:{self.mqtt_url_remaining()}") if message.topic.startswith("prod/thing/update/"): grill_id = message.topic[len("prod/thing/update/"):] self.grill_status[grill_id] = json.loads(message.payload) @@ -315,7 +316,7 @@ async def api_wrapper( ) -> dict: """Get information from the API.""" try: - async with async_timeout.timeout(TIMEOUT, loop=asyncio.get_event_loop()): + async with async_timeout.timeout(TIMEOUT): if method == "get": response = await self.request.get(url, headers=headers) data = await response.read()