diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index de852632f..5265e45c8 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -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 | diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java index 67d1965c3..0e2bb8884 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java @@ -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 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 properties) { diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/i18n/tesla.properties b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/i18n/tesla.properties index 456337296..1bd21f1fb 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/i18n/tesla.properties +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/i18n/tesla.properties @@ -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 diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml index de6cb004a..abf97d9da 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml @@ -58,10 +58,22 @@ - Switch + Number Indicates the state of the central display in the vehicle - + + + + + + + + + + + + + Switch