- fixed issue with unmapped op modes

- disabled dishwasher entities for now
This commit is contained in:
Jack Simbah 2020-12-17 22:14:56 -05:00
parent df8309df86
commit efa8ccc82a
2 changed files with 13 additions and 8 deletions

View File

@ -184,13 +184,13 @@ class DishwasherApi(ApplianceApi):
base_entities = super().get_all_entities() base_entities = super().get_all_entities()
dishwasher_entities = [ dishwasher_entities = [
GeErdSensor(self, ErdCode.CYCLE_NAME), #GeErdSensor(self, ErdCode.CYCLE_NAME),
GeErdSensor(self, ErdCode.CYCLE_STATE), #GeErdSensor(self, ErdCode.CYCLE_STATE),
GeErdSensor(self, ErdCode.OPERATING_MODE), #GeErdSensor(self, ErdCode.OPERATING_MODE),
GeErdSensor(self, ErdCode.PODS_REMAINING_VALUE), #GeErdSensor(self, ErdCode.PODS_REMAINING_VALUE),
GeErdSensor(self, ErdCode.RINSE_AGENT), #GeErdSensor(self, ErdCode.RINSE_AGENT),
GeErdSensor(self, ErdCode.SOUND), #GeErdSensor(self, ErdCode.SOUND),
GeErdSensor(self, ErdCode.TIME_REMAINING), #GeErdSensor(self, ErdCode.TIME_REMAINING),
] ]
entities = base_entities + dishwasher_entities entities = base_entities + dishwasher_entities
return entities return entities

View File

@ -49,7 +49,7 @@ COOK_MODE_OP_MAP = bidict({
ErdOvenCookMode.CONVMULTIBAKE_NOOPTION: OP_MODE_CONVMULTIBAKE, ErdOvenCookMode.CONVMULTIBAKE_NOOPTION: OP_MODE_CONVMULTIBAKE,
ErdOvenCookMode.CONVBAKE_NOOPTION: OP_MODE_CONVBAKE, ErdOvenCookMode.CONVBAKE_NOOPTION: OP_MODE_CONVBAKE,
ErdOvenCookMode.CONVROAST_NOOPTION: OP_MODE_CONVROAST, ErdOvenCookMode.CONVROAST_NOOPTION: OP_MODE_CONVROAST,
ErdOvenCookMode.BAKE_NOOPTION: OP_MODE_BAKE, ErdOvenCookMode.BAKE_NOOPTION: OP_MODE_BAKE
}) })
class GeOvenHeaterEntity(GeEntity, WaterHeaterEntity): class GeOvenHeaterEntity(GeEntity, WaterHeaterEntity):
@ -118,8 +118,13 @@ class GeOvenHeaterEntity(GeEntity, WaterHeaterEntity):
@property @property
def operation_list(self) -> List[str]: def operation_list(self) -> List[str]:
#lookup all the available cook modes
erd_code = self.get_erd_code("AVAILABLE_COOK_MODES") erd_code = self.get_erd_code("AVAILABLE_COOK_MODES")
cook_modes: Set[ErdOvenCookMode] = self.appliance.get_erd_value(erd_code) 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 = [o for o in (COOK_MODE_OP_MAP[c] for c in cook_modes) if o]
op_modes = [OP_MODE_OFF] + op_modes op_modes = [OP_MODE_OFF] + op_modes
return op_modes return op_modes