Skip to content

Commit

Permalink
- fixed convertable drawer issue (resolves #243)
Browse files Browse the repository at this point in the history
  • Loading branch information
simbaja committed May 8, 2024
1 parent 686ed63 commit 62692f6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from gehomesdk import ErdConvertableDrawerMode
from homeassistant.const import UnitOfTemperature
from homeassistant.util.unit_system import UnitSystem
from homeassistant.util.unit_system import UnitSystem, UnitOfTemperature
from ..common import OptionsConverter

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -34,15 +34,15 @@ def from_option_string(self, value: str) -> Any:
v = value.split(" ")[0]
return ErdConvertableDrawerMode[v.upper()]
except:
_LOGGER.warn(f"Could not set hood light level to {value.upper()}")
_LOGGER.warn(f"Could not set drawer mode to {value.upper()}")
return ErdConvertableDrawerMode.NA
def to_option_string(self, value: ErdConvertableDrawerMode) -> Optional[str]:
try:
if value is not None:
v = value.stringify()
t = _TEMP_MAP.get(value, None)

if t and self._units.is_metric:
if t and self._units.temperature_unit == UnitOfTemperature.CELSIUS:
t = self._units.temperature(float(t), UnitOfTemperature.FAHRENHEIT)
t = round(t,1)

Expand Down

0 comments on commit 62692f6

Please sign in to comment.