Use correct exception type for RainMachine select API error (#79309)

This commit is contained in:
Aaron Bach 2022-09-29 08:58:16 -06:00 committed by GitHub
parent da445e515b
commit db1797beb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ from homeassistant.components.select import SelectEntity, SelectEntityDescriptio
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_UNIT_SYSTEM_IMPERIAL
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -145,7 +146,7 @@ class FreezeProtectionTemperatureSelect(RainMachineEntity, SelectEntity):
{self.entity_description.data_key: self._label_to_api_value_map[option]}
)
except RainMachineError as err:
raise ValueError(f"Error while setting {self.name}: {err}") from err
raise HomeAssistantError(f"Error while setting {self.name}: {err}") from err
@callback
def update_from_latest_data(self) -> None: