From 54cce26573d70d064341e8ecc82e7f998b88dd35 Mon Sep 17 00:00:00 2001 From: Noel Bundick Date: Sat, 7 Jan 2023 21:41:51 +0000 Subject: [PATCH 1/2] support more accessories --- custom_components/traeger/climate.py | 6 ++++-- custom_components/traeger/entity.py | 2 +- custom_components/traeger/sensor.py | 9 ++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/custom_components/traeger/climate.py b/custom_components/traeger/climate.py index c61e6ee..952ed2b 100644 --- a/custom_components/traeger/climate.py +++ b/custom_components/traeger/climate.py @@ -227,13 +227,15 @@ def icon(self): def current_temperature(self): if self.grill_accessory is None: return 0 - return self.grill_accessory["probe"]["get_temp"] + acc_type = self.grill_accessory["type"] + return self.grill_accessory[acc_type]["get_temp"] @property def target_temperature(self): if self.grill_accessory is None: return 0 - return self.grill_accessory["probe"]["set_temp"] + acc_type = self.grill_accessory["type"] + return self.grill_accessory[acc_type]["set_temp"] @property def max_temp(self): diff --git a/custom_components/traeger/entity.py b/custom_components/traeger/entity.py index f336e2c..5e97324 100644 --- a/custom_components/traeger/entity.py +++ b/custom_components/traeger/entity.py @@ -88,7 +88,7 @@ def grill_add_accessories(self): if self.device_state is None: return for accessory in self.device_state["acc"]: - if accessory["type"] == "probe": + if accessory["type"] in ["probe", "btprobe", "hob"]: if accessory["uuid"] not in self.accessory_status: if self.probe_entity: self.async_add_devices([self.probe_entity(self.client, self.grill_id, accessory["uuid"])]) diff --git a/custom_components/traeger/sensor.py b/custom_components/traeger/sensor.py index 1651b81..408e73d 100644 --- a/custom_components/traeger/sensor.py +++ b/custom_components/traeger/sensor.py @@ -307,14 +307,17 @@ def state(self): if self.grill_accessory is None: return "idle" - target_temp = self.grill_accessory["probe"]["set_temp"] - probe_temp = self.grill_accessory["probe"]["get_temp"] + acc_type = self.grill_accessory["type"] + target_temp = self.grill_accessory[acc_type]["set_temp"] + probe_temp = self.grill_accessory[acc_type]["get_temp"] target_changed = target_temp != self.previous_target_temp grill_mode = self.grill_state["system_status"] fell_out_temp = 102 if self.grill_units == TEMP_CELSIUS else 215 # Latch probe alarm, reset if target changed or grill leaves active modes - if self.grill_accessory["probe"]["alarm_fired"]: + if "alarm_fired" not in self.grill_accessory[acc_type]: + self.probe_alarm = False + elif self.grill_accessory[acc_type]["alarm_fired"]: self.probe_alarm = True elif ((target_changed and target_temp != 0) or (grill_mode not in self.active_modes)): From 8e9875b9ceff91b2aa1bfc24f60aa93b89f076d5 Mon Sep 17 00:00:00 2001 From: njobrien <59174199@users.noreply.github.com> Date: Fri, 16 Jun 2023 09:52:11 -0500 Subject: [PATCH 2/2] VersUpdt --- custom_components/traeger/const.py | 2 +- custom_components/traeger/manifest.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/traeger/const.py b/custom_components/traeger/const.py index a5c22e6..59df7c1 100644 --- a/custom_components/traeger/const.py +++ b/custom_components/traeger/const.py @@ -5,7 +5,7 @@ NAME = "Traeger" DOMAIN = "traeger" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "2023.06.11" +VERSION = "2023.06.16" ATTRIBUTION = "" ISSUE_URL = "https://github.com/njobrien1006/hass_traeger/issues" diff --git a/custom_components/traeger/manifest.json b/custom_components/traeger/manifest.json index 7f5f5c2..54bf31a 100644 --- a/custom_components/traeger/manifest.json +++ b/custom_components/traeger/manifest.json @@ -13,5 +13,5 @@ "documentation": "https://github.com/njobrien1006/hass_traeger", "iot_class": "cloud_push", "issue_tracker": "https://github.com/njobrien1006/hass_traeger/issues", - "version": "2023.06.11" -} + "version": "2023.06.16" +} \ No newline at end of file