1 """Support for Spa Client selects."""
3 from pybalboa
import SpaControl
4 from pybalboa.enums
import LowHighRange
10 from .
import BalboaConfigEntry
11 from .entity
import BalboaEntity
16 entry: BalboaConfigEntry,
17 async_add_entities: AddEntitiesCallback,
19 """Set up the spa select entity."""
20 spa = entry.runtime_data
25 """Representation of a Temperature Range select."""
27 _attr_translation_key =
"temperature_range"
29 LowHighRange.LOW.name.lower(),
30 LowHighRange.HIGH.name.lower(),
33 def __init__(self, control: SpaControl) ->
None:
34 """Initialise the select."""
35 super().
__init__(control.client,
"TempHiLow")
40 """Return current select option."""
41 if self.
_control_control.state == LowHighRange.HIGH:
42 return LowHighRange.HIGH.name.lower()
43 return LowHighRange.LOW.name.lower()
46 """Select temperature range high/low mode."""
47 if option == LowHighRange.HIGH.name.lower():
48 await self.
_client_client.set_temperature_range(LowHighRange.HIGH)
50 await self.
_client_client.set_temperature_range(LowHighRange.LOW)
None async_select_option(self, str option)
str|None current_option(self)
None __init__(self, SpaControl control)
None async_setup_entry(HomeAssistant hass, BalboaConfigEntry entry, AddEntitiesCallback async_add_entities)