Adding additional switches and sensors for Tesla (#12241)
* Adding switch for maxrange charging and sensors for odometer and range * Fixing style errors
This commit is contained in:
parent
ae257651bf
commit
36e9f523d1
3 changed files with 60 additions and 14 deletions
|
@ -78,6 +78,14 @@ class TeslaSensor(TeslaDevice, Entity):
|
|||
self._unit = TEMP_FAHRENHEIT
|
||||
else:
|
||||
self._unit = TEMP_CELSIUS
|
||||
elif (self.tesla_device.bin_type == 0xA or
|
||||
self.tesla_device.bin_type == 0xB):
|
||||
self.current_value = self.tesla_device.get_value()
|
||||
tesla_dist_unit = self.tesla_device.measurement
|
||||
if tesla_dist_unit == 'LENGTH_MILES':
|
||||
self._unit = LENGTH_MILES
|
||||
else:
|
||||
self._unit = LENGTH_KILOMETERS
|
||||
else:
|
||||
self.current_value = self.tesla_device.get_value()
|
||||
if self.tesla_device.bin_type == 0x5:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue