Closed iancg closed 1 year ago
Same with my 2017 model S with 3.13.0 integration. And I lost battery sensor..
@drlauridsen if you comment out line 90 of sensor.py in config/custom_components/tesla_custom and restart HA it will get it working again (but not heated steering wheel control) until it gets fixed properly.
#entities.append(TeslaCarHeatedSteeringWheel(hass, car, coordinator))
Hi @Megabytemb , What's the best solution for this? Do you need any info from a 2017 era car to fix? I'm guessing our selects should just have Off/On or maybe we shouldn't have the select at all?
hmm, if there's a way to identify that you don't have "Auto" that would be good. No idea how though.
for now, I wonder if it could be as simple as returning "None" for the current selection as it can't be determined?
someone wanna try updating the current option code to
@property
def current_option(self):
"""Return current heated steering setting."""
if self._car.is_auto_steering_wheel_heat is True:
current_str = "Auto"
else:
current_value = self._car.get_heated_steering_wheel_level()
current_str = next(
(
key
for key, val in STEERING_HEATER_OPTIONS_MAP.items()
if val == current_value
),
None,
)
if current_str is None:
return None
options_idx = STEERING_HEATER_OPTIONS.index(current_str)
return STEERING_HEATER_OPTIONS[options_idx]
hmm, if there's a way to identify that you don't have "Auto" that would be good. No idea how though.
This appears to work for the 2017 style cars (line 90 of sensor.py)
if car.get_heated_steering_wheel_level() is not None:
entities.append(TeslaCarHeatedSteeringWheel(hass, car, coordinator))
Given get_heated_steering_wheel_level() was returning None (and then it couldn't find None in the map and thus used None in the second lookup which caused the error I thought that might work - otherwise we are going to have a selector which has no value.
I don't have a dev environment for this (I'm just editing the file in my custom_components/tesla_custom directory on my "production" respberry pi) and I don't have a new enough car to test it still works for the cars with an auto heater, would you mind testing it @Megabytemb and submitting it if it still works for you please.
Same issue for me with battery state not found at all and steering_wheel_heater
Ok i've created a pull request that hopefully fixed this issue.
I tried to emulate an older model S using tests, so we'll see how we go
@drlauridsen if you comment out line 90 of sensor.py in config/custom_components/tesla_custom and restart HA it will get it working again (but not heated steering wheel control) until it gets fixed properly.
#entities.append(TeslaCarHeatedSteeringWheel(hass, car, coordinator))
I have the same problem, have a model 3 from 2019 and everything works fine except the battery information that is not showing up at all.
I don’t have that code on sensor.py, is there any other solution yet? Thanks.
Version of the custom_component
v3.13.0
Configuration
Describe the bug
I have a 2017 Model X which has the older heated steering wheel which doesn't have auto or multiple levels. Since the latest update which included a select for the heated steering wheel, I get an error from the integration and numerous sensors are not available.
I added some temporary debug logging as the value of _car.get_heated_steering_wheel_level() seemed to be interesting:
2023-06-14 11:11:03.188 DEBUG (MainThread) [custom_components.tesla_custom.select] current_value: None
Debug log