From efa8ccc82a4e184f22ef17376b70cd7b39f62205 Mon Sep 17 00:00:00 2001 From: Jack Simbah Date: Thu, 17 Dec 2020 22:14:56 -0500 Subject: [PATCH] - fixed issue with unmapped op modes - disabled dishwasher entities for now --- ge_kitchen/appliance_api.py | 14 +++++++------- ge_kitchen/appliance_entity_types/oven_entity.py | 7 ++++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ge_kitchen/appliance_api.py b/ge_kitchen/appliance_api.py index 57d0ec8..ecd3561 100644 --- a/ge_kitchen/appliance_api.py +++ b/ge_kitchen/appliance_api.py @@ -184,13 +184,13 @@ class DishwasherApi(ApplianceApi): base_entities = super().get_all_entities() dishwasher_entities = [ - GeErdSensor(self, ErdCode.CYCLE_NAME), - GeErdSensor(self, ErdCode.CYCLE_STATE), - GeErdSensor(self, ErdCode.OPERATING_MODE), - GeErdSensor(self, ErdCode.PODS_REMAINING_VALUE), - GeErdSensor(self, ErdCode.RINSE_AGENT), - GeErdSensor(self, ErdCode.SOUND), - GeErdSensor(self, ErdCode.TIME_REMAINING), + #GeErdSensor(self, ErdCode.CYCLE_NAME), + #GeErdSensor(self, ErdCode.CYCLE_STATE), + #GeErdSensor(self, ErdCode.OPERATING_MODE), + #GeErdSensor(self, ErdCode.PODS_REMAINING_VALUE), + #GeErdSensor(self, ErdCode.RINSE_AGENT), + #GeErdSensor(self, ErdCode.SOUND), + #GeErdSensor(self, ErdCode.TIME_REMAINING), ] entities = base_entities + dishwasher_entities return entities diff --git a/ge_kitchen/appliance_entity_types/oven_entity.py b/ge_kitchen/appliance_entity_types/oven_entity.py index 70f9a64..416d512 100644 --- a/ge_kitchen/appliance_entity_types/oven_entity.py +++ b/ge_kitchen/appliance_entity_types/oven_entity.py @@ -49,7 +49,7 @@ COOK_MODE_OP_MAP = bidict({ ErdOvenCookMode.CONVMULTIBAKE_NOOPTION: OP_MODE_CONVMULTIBAKE, ErdOvenCookMode.CONVBAKE_NOOPTION: OP_MODE_CONVBAKE, ErdOvenCookMode.CONVROAST_NOOPTION: OP_MODE_CONVROAST, - ErdOvenCookMode.BAKE_NOOPTION: OP_MODE_BAKE, + ErdOvenCookMode.BAKE_NOOPTION: OP_MODE_BAKE }) class GeOvenHeaterEntity(GeEntity, WaterHeaterEntity): @@ -118,8 +118,13 @@ class GeOvenHeaterEntity(GeEntity, WaterHeaterEntity): @property def operation_list(self) -> List[str]: + #lookup all the available cook modes erd_code = self.get_erd_code("AVAILABLE_COOK_MODES") cook_modes: Set[ErdOvenCookMode] = self.appliance.get_erd_value(erd_code) + #make sure that we limit them to the list of known codes + cook_modes = cook_modes.intersection(COOK_MODE_OP_MAP.keys()) + + _LOGGER.debug(f"found cook modes {cook_modes}") op_modes = [o for o in (COOK_MODE_OP_MAP[c] for c in cook_modes) if o] op_modes = [OP_MODE_OFF] + op_modes return op_modes