Check for upper oven light when there is a lower oven (#174)

Resolves issue #121
This commit is contained in:
Chris Petersen 2023-06-17 13:33:32 -07:00 committed by GitHub
parent edba2bb4f2
commit 3d18d57a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,8 @@ class OvenApi(ApplianceApi):
])
if has_upper_raw_temperature:
oven_entities.append(GeErdSensor(self, ErdCode.UPPER_OVEN_RAW_TEMPERATURE))
if upper_light_availability is None or upper_light_availability.is_available or upper_light is not None:
oven_entities.append(GeOvenLightLevelSelect(self, ErdCode.UPPER_OVEN_LIGHT))
if has_lower_raw_temperature:
oven_entities.append(GeErdSensor(self, ErdCode.LOWER_OVEN_RAW_TEMPERATURE))
if lower_light_availability is None or lower_light_availability.is_available or lower_light is not None:
@ -117,4 +119,4 @@ class OvenApi(ApplianceApi):
return ''.join(['_'+c.lower() if c.isupper() else c for c in s]).lstrip('_')
def _temperature_code(self, has_raw: bool):
return "RAW_TEMPERATURE" if has_raw else "DISPLAY_TEMPERATURE"
return "RAW_TEMPERATURE" if has_raw else "DISPLAY_TEMPERATURE"