[tesla] Change center_display_state from switch to number (#12030)

* Change center_display_state from switch to number

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* Update property file

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer 2022-01-12 23:06:31 +01:00 committed by GitHub
parent ab2f6b0afe
commit e9b0620c86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 15 deletions

View File

@ -100,7 +100,7 @@ Additionally, these advanced channels are available (not all are available on al
| batteryheaternopower | Switch | Battery Heater Power | Indicates if there is enough power to use the battery heater |
| batteryrange | Number:Length | Battery Range | Range of the battery |
| calendarenabled | Switch | Calendar Enabled | Indicates if access to a remote calendar is enabled |
| centerdisplay | Switch | Central Display State | Indicates the state of the central display in the vehicle |
| centerdisplay | Number | Central Display State | Indicates the state of the central display in the vehicle, see [here](https://tesla-api.timdorr.com/vehicle/state/vehiclestate) for valid values |
| centerrearseatheater | Switch | Center Rear Seat Heater | Indicates if the center rear seat heater is switched on |
| charge | Switch | Charge | Start (ON) or stop (OFF) charging |
| chargecable | String | Charge Cable | Undocumented / To be defined |

View File

@ -119,18 +119,7 @@ public class TeslaChannelSelectorProxy {
}
},
CAR_VERSION("car_version", "version", StringType.class, true),
CENTER_DISPLAY("center_display_state", "centerdisplay", OnOffType.class, false) {
@Override
public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) {
if (s.equals("true") || s.equals("1")) {
return super.getState("ON");
}
if (s.equals("false") || s.equals("0")) {
return super.getState("OFF");
}
return super.getState(s);
}
},
CENTER_DISPLAY("center_display_state", "centerdisplay", DecimalType.class, false),
CHARGE(null, "charge", OnOffType.class, false) {
@Override
public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) {

View File

@ -71,6 +71,15 @@ channel-type.tesla.calendarenabled.label = Calendar Enabled
channel-type.tesla.calendarenabled.description = Indicates if access to a remote calendar is enabled
channel-type.tesla.centerdisplay.label = Central Display State
channel-type.tesla.centerdisplay.description = Indicates the state of the central display in the vehicle
channel-type.tesla.centerdisplay.state.option.0 = Off
channel-type.tesla.centerdisplay.state.option.2 = On, Standby or Camp Mode
channel-type.tesla.centerdisplay.state.option.3 = On, Charging Screen
channel-type.tesla.centerdisplay.state.option.4 = On
channel-type.tesla.centerdisplay.state.option.5 = On, Big Charging Screen
channel-type.tesla.centerdisplay.state.option.6 = On, Ready to Unlock
channel-type.tesla.centerdisplay.state.option.7 = Sentry Mode
channel-type.tesla.centerdisplay.state.option.8 = Dog Mode
channel-type.tesla.centerdisplay.state.option.9 = Media
channel-type.tesla.centerrearseatheater.label = Center Rear Seat Heater
channel-type.tesla.centerrearseatheater.description = Indicates if the center rear seat heater is switched on
channel-type.tesla.charge.label = Charge

View File

@ -58,10 +58,22 @@
<state readOnly="true"></state>
</channel-type>
<channel-type id="centerdisplay" advanced="true">
<item-type>Switch</item-type>
<item-type>Number</item-type>
<label>Central Display State</label>
<description>Indicates the state of the central display in the vehicle</description>
<state readOnly="true"></state>
<state readOnly="true">
<options>
<option value="0">Off</option>
<option value="2">On, Standby or Camp Mode</option>
<option value="3">On, Charging Screen</option>
<option value="4">On</option>
<option value="5">On, Big Charging Screen</option>
<option value="6">On, Ready to Unlock</option>
<option value="7">Sentry Mode</option>
<option value="8">Dog Mode</option>
<option value="9">Media</option>
</options>
</state>
</channel-type>
<channel-type id="centerrearseatheater" advanced="true">
<item-type>Switch</item-type>