Skip to content

Commit

Permalink
Update traeger.py
Browse files Browse the repository at this point in the history
-Re-add grill message debug.
-Fix loop=loop per HA warning.
  • Loading branch information
njobrien1006 authored and sebirdman committed Dec 29, 2021
1 parent 5dda3ab commit 1cc032c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/traeger/traeger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 1cc032c

Please sign in to comment.