1818
1919
2020KEEPER_MAP = {
21- "Keep On " : 1 ,
22- "Dog Mode " : 2 ,
23- "Camp Mode " : 3 ,
21+ "keep " : 1 ,
22+ "dog " : 2 ,
23+ "camp " : 3 ,
2424}
2525
2626
@@ -46,8 +46,12 @@ class TeslaCarClimate(TeslaCarEntity, ClimateEntity):
4646 | ClimateEntityFeature .FAN_MODE
4747 )
4848 _attr_hvac_modes = [HVACMode .HEAT_COOL , HVACMode .OFF ]
49- _attr_preset_modes = ["Normal" , "Defrost" , "Keep On" , "Dog Mode" , "Camp Mode" ]
50- _attr_fan_modes = ["Off" , "Bioweapon Mode" ]
49+ _attr_preset_modes = ["normal" , "defrost" , "keep" , "dog" , "camp" ]
50+ _attr_fan_modes = ["off" , "bioweapon" ]
51+
52+ @property
53+ def translation_key (self ):
54+ return "car_climate"
5155
5256 @property
5357 def hvac_mode (self ) -> HVACMode :
@@ -121,29 +125,29 @@ def preset_mode(self):
121125 Requires SUPPORT_PRESET_MODE.
122126 """
123127 if self ._car .defrost_mode == 2 :
124- return "Defrost "
128+ return "defrost "
125129 if self ._car .climate_keeper_mode == "dog" :
126- return "Dog Mode "
130+ return "dog "
127131 if self ._car .climate_keeper_mode == "camp" :
128- return "Camp Mode "
132+ return "camp "
129133 if self ._car .climate_keeper_mode == "on" :
130- return "Keep On "
134+ return "keep "
131135
132- return "Normal "
136+ return "normal "
133137
134138 async def async_set_preset_mode (self , preset_mode : str ) -> None :
135139 """Set new preset mode."""
136140 _LOGGER .debug ("%s: Setting preset_mode to: %s" , self .name , preset_mode )
137141
138- if preset_mode == "Normal " :
142+ if preset_mode == "normal " :
139143 # If setting Normal, we need to check Defrost And Keep modes.
140144 if self ._car .defrost_mode != 0 :
141145 await self ._car .set_max_defrost (0 )
142146
143147 if self ._car .climate_keeper_mode != 0 :
144148 await self ._car .set_climate_keeper_mode (0 )
145149
146- elif preset_mode == "Defrost " :
150+ elif preset_mode == "defrost " :
147151 await self ._car .set_max_defrost (2 )
148152
149153 else :
@@ -158,12 +162,12 @@ def fan_mode(self):
158162 Requires SUPPORT_FAN_MODE.
159163 """
160164 if self ._car .bioweapon_mode :
161- return "Bioweapon Mode "
165+ return "bioweapon "
162166
163- return "Off "
167+ return "off "
164168
165169 async def async_set_fan_mode (self , fan_mode : str ) -> None :
166170 """Set new fan mode as bioweapon mode."""
167171 _LOGGER .debug ("%s: Setting fan_mode to: %s" , self .name , fan_mode )
168172
169- await self ._car .set_bioweapon_mode (fan_mode == "Bioweapon Mode " )
173+ await self ._car .set_bioweapon_mode (fan_mode == "bioweapon " )
0 commit comments