From 57b62ea360ebb9747c83f730cea2f03d0bacaa9d Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 11:55:25 +0200 Subject: [PATCH 01/21] [tesla] Add channels and documentation for active routing Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 18 ++++++++++- .../internal/TeslaChannelSelectorProxy.java | 21 +++++++++++++ .../tesla/internal/protocol/DriveState.java | 6 ++++ .../resources/OH-INF/i18n/tesla.properties | 11 +++++++ .../main/resources/OH-INF/thing/channels.xml | 31 +++++++++++++++++++ .../main/resources/OH-INF/thing/model3.xml | 5 +++ .../main/resources/OH-INF/thing/models.xml | 5 +++ .../main/resources/OH-INF/thing/modelx.xml | 5 +++ .../main/resources/OH-INF/thing/modely.xml | 5 +++ 9 files changed, 106 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index e28d69c8ca03..ac67a790f7ac 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -90,6 +90,11 @@ Additionally, these advanced channels are available (not all are available on al | Channel ID | Item Type | Label | Description | |---------------------------|--------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------| +| ar_destination | String | Route destination | Name of the destination | +| ar_location | Location | Route location | Location of the destination | +| ar_distancetoarrival | Number | Distance to arrival | Distance to drive to the destination | +| ar_minutestoarrival | Number:Time | Minutes to arrival | Minutes to drive to the destination | +| ar_trafficminutesdelay | Number:Time | Traffic delay | Minutes of delay due to traffic | | autoparkstate | String | Autopark State | Undocumented / To be defined | | autoparkstyle | String | Autopark Style | Undocumented / To be defined | | batterycurrent | Number:ElectricCurrent | Battery Current | Current (Ampere) floating into (+) or out (-) of the battery | @@ -200,7 +205,6 @@ demo.Things: Bridge tesla:account:myaccount "My Tesla Account" [ refreshToken="xxxx" ] { model3 mycar "My favorite car" [ vin="5YJSA7H25FFP53736"] } -``` demo.items: @@ -263,6 +267,11 @@ Number:Temperature TeslaTemperature {channel="account:model3:myaccou Number:Temperature TeslaTemperatureCombined {channel="account:model3:myaccount:mycar:combinedtemp"} Number:Temperature TeslaInsideTemperature {channel="account:model3:myaccount:mycar:insidetemp"} Number:Temperature TeslaOutsideTemperature {channel="account:model3:myaccount:mycar:outsidetemp"} + +String TeslaDestinationName {channel="account:model3:myaccount:mycar:ar_destination"} +String TeslaDestinationLocation {channel="account:model3:myaccount:mycar:ar_location"} +Number TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:ar_minutestoarrival"} +Number TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:ar_distancetoarrival"} ``` demo.sitemap: @@ -339,6 +348,13 @@ sitemap main label="Main" { Mapview item=TeslaLocation height=10 } + Frame + { + String item=TeslaDestinationName + Number item=TeslaMinutesToArrival + Number item=TeslaDistanceToArrival + Mapview item=TeslaDestinationLocation height=10 + } } } ``` 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 40d5a990ba8a..196566c2b3b5 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 @@ -45,6 +45,27 @@ public class TeslaChannelSelectorProxy { public enum TeslaChannelSelector { API("api_version", "api", DecimalType.class, true), + AR_DESTINATION("active_route_destination", "ar_destination", StringType.class, true), + AR_LATITUDE("active_route_latitude", "ar_location", DecimalType.class, false) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { + proxy.latitude = s; + return new PointType(new StringType(proxy.latitude), new StringType(proxy.longitude), + new StringType(proxy.elevation)); + } + }, + AR_LONGITUDE("active_route_longitude", "ar_location", DecimalType.class, false) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { + proxy.longitude = s; + return new PointType(new StringType(proxy.latitude), new StringType(proxy.longitude), + new StringType(proxy.elevation)); + } + }, + AR_DISTANCE_TO_ARRIVAL("active_route_miles_to_arrival", "ar_distancetoarrival", DecimalType.class, true), + AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "ar_minutestoarrival", DecimalType.class, true), + AR_TRAFFIC_MINUTES_DELAY("active_route_traffic_minutes_delay", "ar_trafficminutesdelay", DecimalType.class, + false), AUTO_COND("is_auto_conditioning_on", "autoconditioning", OnOffType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java index 56ac6f72a259..5751a9ffdb87 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java @@ -20,6 +20,12 @@ */ public class DriveState { + public String active_route_destination; + public double active_route_latitude; + public double active_route_longitude; + public double active_route_miles_to_arrival; + public double active_route_minutes_to_arrival; + public double active_route_traffic_minutes_delay; public double latitude; public double longitude; public double native_latitude; 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 0be5965cb164..dc0b621a6d4b 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 @@ -105,6 +105,17 @@ thing-type.config.tesla.vehicle.vin.description = VIN of the vehicle # channel types +channel-type.tesla.ar_destination.label = Active route destination +channel-type.tesla.ar_destination.description = The position to which to navigate +channel-type.tesla.ar_location.label = Active route Location +channel-type.tesla.ar_location.description = The actual position of the position to which to navigate +channel-type.tesla.ar_distancetoarrival.label = Active route distance to arrival +channel-type.tesla.ar_distancetoarrival.description = Driving distance to the position to which to navigate +channel-type.tesla.ar_minutestoarrival.label = Active route minutes to arrival +channel-type.tesla.ar_minutestoarrival.description = Driving minutes to the position to which to navigate +channel-type.tesla.ar_trafficminutesdelay.label = Active route traffic minutes delay +channel-type.tesla.ar_trafficminutesdelay.description = Delay due to traffic while driving to the position to which to navigate + channel-type.tesla.autoconditioning.label = Auto Conditioning channel-type.tesla.autoconditioning.description = Turns on auto-conditioning (a/c or heating) channel-type.tesla.autoparkstate.label = Autopark State 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 7355d5f368e5..03ec6f8ea375 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 @@ -4,6 +4,37 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + String + + Name of the destination + + + + Location + + Location of the destination + + + + Number + + Distance to drive to the destination + + + + Number:Time + + Minutes to drive to the destination + + + + Number:Time + + Delay to arrive at the destination due to traffic + + + Switch diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml index fdd9b5c4ad29..49f923fcbcd8 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml @@ -14,6 +14,11 @@ A Tesla Model 3 Vehicle + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml index 1a7b7c13ecd8..4dfa64a94286 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml @@ -14,6 +14,11 @@ A Tesla Model S Vehicle + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml index 369fffc35339..99df99e86f48 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml @@ -14,6 +14,11 @@ A Tesla Model X Vehicle + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml index 46fb050f3644..8edc35fc3d03 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml @@ -14,6 +14,11 @@ A Tesla Model Y Vehicle + + + + + From 2c66f2da8dc659b14e46f5af71940592c8c406cf Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:06:05 +0200 Subject: [PATCH 02/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 03ec6f8ea375..e86f2d919a64 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 @@ -6,7 +6,7 @@ String - + Name of the destination From 75ffb28dadf1e48d6037667744af9c6aae12fe9f Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:06:18 +0200 Subject: [PATCH 03/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e86f2d919a64..88344e275a54 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 @@ -12,7 +12,7 @@ Location - + Location of the destination From c5bc7d97bfd1a889f6ea9e765412dd8cd38011ae Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:06:32 +0200 Subject: [PATCH 04/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 88344e275a54..20d79fc23a1f 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 @@ -24,7 +24,7 @@ Number:Time - + Minutes to drive to the destination From 764e59499510c3300c11f80745275d8139c2d2c7 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:06:43 +0200 Subject: [PATCH 05/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 1 + 1 file changed, 1 insertion(+) 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 20d79fc23a1f..6efa45c5c971 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 @@ -26,6 +26,7 @@ Number:Time Minutes to drive to the destination + Time From 7cd1d5ce7334ecd8ca0d66539be1d2d2367215ed Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:06:54 +0200 Subject: [PATCH 06/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 1 + 1 file changed, 1 insertion(+) 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 6efa45c5c971..0e084770a605 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 @@ -33,6 +33,7 @@ Number:Time Delay to arrive at the destination due to traffic + Time From ab9257e4d41cb587e8ca5480b633ca0742547272 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 14:31:58 +0200 Subject: [PATCH 07/21] [tesla] added UoM as suggested on review Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0e084770a605..528ccabf2ac4 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 @@ -17,7 +17,7 @@ - Number + Number:Length Distance to drive to the destination From 498a92a283ea7a7541a16e825912cd26139e47e3 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 15:31:20 +0200 Subject: [PATCH 08/21] [tesla] added UoM and conversion as suggested on review Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 6 ++--- .../internal/TeslaChannelSelectorProxy.java | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index ac67a790f7ac..644ef81f8be0 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -92,7 +92,7 @@ Additionally, these advanced channels are available (not all are available on al |---------------------------|--------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------| | ar_destination | String | Route destination | Name of the destination | | ar_location | Location | Route location | Location of the destination | -| ar_distancetoarrival | Number | Distance to arrival | Distance to drive to the destination | +| ar_distancetoarrival | Number:Length | Distance to arrival | Distance to drive to the destination | | ar_minutestoarrival | Number:Time | Minutes to arrival | Minutes to drive to the destination | | ar_trafficminutesdelay | Number:Time | Traffic delay | Minutes of delay due to traffic | | autoparkstate | String | Autopark State | Undocumented / To be defined | @@ -270,8 +270,8 @@ Number:Temperature TeslaOutsideTemperature {channel="account:model3:myaccou String TeslaDestinationName {channel="account:model3:myaccount:mycar:ar_destination"} String TeslaDestinationLocation {channel="account:model3:myaccount:mycar:ar_location"} -Number TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:ar_minutestoarrival"} -Number TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:ar_distancetoarrival"} +Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:ar_minutestoarrival"} +Number:Length TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:ar_distancetoarrival"} ``` demo.sitemap: 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 196566c2b3b5..8390b33be346 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 @@ -62,10 +62,31 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); + } + }, + AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "ar_minutestoarrival", DecimalType.class, true) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, Units.MINUTE); + } + }, AR_TRAFFIC_MINUTES_DELAY("active_route_traffic_minutes_delay", "ar_trafficminutesdelay", DecimalType.class, - false), + false) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, Units.MINUTE); + } + }, AUTO_COND("is_auto_conditioning_on", "autoconditioning", OnOffType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { From 279290af9abd8a5dbd58779b5e1d42ac15531bf4 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 17:42:27 +0200 Subject: [PATCH 09/21] [tesla] renamed channels as suggested on review Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 18 +++++++++--------- .../internal/TeslaChannelSelectorProxy.java | 10 +++++----- .../main/resources/OH-INF/thing/channels.xml | 10 +++++----- .../src/main/resources/OH-INF/thing/model3.xml | 10 +++++----- .../src/main/resources/OH-INF/thing/models.xml | 10 +++++----- .../src/main/resources/OH-INF/thing/modelx.xml | 10 +++++----- .../src/main/resources/OH-INF/thing/modely.xml | 10 +++++----- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index 644ef81f8be0..94b370f4c486 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -90,11 +90,11 @@ Additionally, these advanced channels are available (not all are available on al | Channel ID | Item Type | Label | Description | |---------------------------|--------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------| -| ar_destination | String | Route destination | Name of the destination | -| ar_location | Location | Route location | Location of the destination | -| ar_distancetoarrival | Number:Length | Distance to arrival | Distance to drive to the destination | -| ar_minutestoarrival | Number:Time | Minutes to arrival | Minutes to drive to the destination | -| ar_trafficminutesdelay | Number:Time | Traffic delay | Minutes of delay due to traffic | +| destinationname | String | Route destination | Name of the destination | +| destinationlocation | Location | Route location | Location of the destination | +| distancetoarrival | Number:Length | Distance to arrival | Distance to drive to the destination | +| minutestoarrival | Number:Time | Minutes to arrival | Minutes to drive to the destination | +| trafficminutesdelay | Number:Time | Traffic delay | Minutes of delay due to traffic | | autoparkstate | String | Autopark State | Undocumented / To be defined | | autoparkstyle | String | Autopark Style | Undocumented / To be defined | | batterycurrent | Number:ElectricCurrent | Battery Current | Current (Ampere) floating into (+) or out (-) of the battery | @@ -268,10 +268,10 @@ Number:Temperature TeslaTemperatureCombined {channel="account:model3:myaccou Number:Temperature TeslaInsideTemperature {channel="account:model3:myaccount:mycar:insidetemp"} Number:Temperature TeslaOutsideTemperature {channel="account:model3:myaccount:mycar:outsidetemp"} -String TeslaDestinationName {channel="account:model3:myaccount:mycar:ar_destination"} -String TeslaDestinationLocation {channel="account:model3:myaccount:mycar:ar_location"} -Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:ar_minutestoarrival"} -Number:Length TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:ar_distancetoarrival"} +String TeslaDestinationName {channel="account:model3:myaccount:mycar:destinationname"} +String TeslaDestinationLocation {channel="account:model3:myaccount:mycar:destinationlocation"} +Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:minutestoarrival"} +Number:Length TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:distancetoarrival"} ``` demo.sitemap: 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 8390b33be346..e8b1f27e3ebf 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 @@ -45,7 +45,7 @@ public class TeslaChannelSelectorProxy { public enum TeslaChannelSelector { API("api_version", "api", DecimalType.class, true), - AR_DESTINATION("active_route_destination", "ar_destination", StringType.class, true), + AR_DESTINATION("active_route_destination", "destinationname", StringType.class, true), AR_LATITUDE("active_route_latitude", "ar_location", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { @@ -54,7 +54,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { proxy.longitude = s; @@ -62,7 +62,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { State someState = super.getState(s); @@ -70,7 +70,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map(value, ImperialUnits.MILE); } }, - AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "ar_minutestoarrival", DecimalType.class, true) { + AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "minutestoarrival", DecimalType.class, true) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { State someState = super.getState(s); @@ -78,7 +78,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map(value, Units.MINUTE); } }, - AR_TRAFFIC_MINUTES_DELAY("active_route_traffic_minutes_delay", "ar_trafficminutesdelay", DecimalType.class, + AR_TRAFFIC_MINUTES_DELAY("active_route_traffic_minutes_delay", "trafficminutesdelay", DecimalType.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/thing/channels.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml index 528ccabf2ac4..47203c0f0d8e 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 @@ -4,32 +4,32 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - + String Name of the destination - + Location Location of the destination - + Number:Length Distance to drive to the destination - + Number:Time Minutes to drive to the destination Time - + Number:Time Delay to arrive at the destination due to traffic diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml index 49f923fcbcd8..0a59bd1e5e1e 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml @@ -14,11 +14,11 @@ A Tesla Model 3 Vehicle - - - - - + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml index 4dfa64a94286..9286ec9fb927 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml @@ -14,11 +14,11 @@ A Tesla Model S Vehicle - - - - - + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml index 99df99e86f48..6075712d5459 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml @@ -14,11 +14,11 @@ A Tesla Model X Vehicle - - - - - + + + + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml index 8edc35fc3d03..b8478e6c6321 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml @@ -14,11 +14,11 @@ A Tesla Model Y Vehicle - - - - - + + + + + From f12fedc6d14bcff29ffb252808ea3dd518284ca5 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 18:35:38 +0200 Subject: [PATCH 10/21] [tesla] add update instructions as suggested on review Signed-off-by: Hakan Tandogan --- .../resources/OH-INF/update/instructions.xml | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/update/instructions.xml diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/update/instructions.xml new file mode 100644 index 000000000000..e21eda2f56dd --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/update/instructions.xml @@ -0,0 +1,85 @@ + + + + + + + tesla:destinationname + + + tesla:destinationlocation + + + tesla:distancetoarrival + + + tesla:minutestoarrival + + + tesla:trafficminutesdelay + + + + + + + + tesla:destinationname + + + tesla:destinationlocation + + + tesla:distancetoarrival + + + tesla:minutestoarrival + + + tesla:trafficminutesdelay + + + + + + + + tesla:destinationname + + + tesla:destinationlocation + + + tesla:distancetoarrival + + + tesla:minutestoarrival + + + tesla:trafficminutesdelay + + + + + + + + tesla:destinationname + + + tesla:destinationlocation + + + tesla:distancetoarrival + + + tesla:minutestoarrival + + + tesla:trafficminutesdelay + + + + From b45a2487a5e834421870eee10397a5280efe9df0 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 18:39:09 +0200 Subject: [PATCH 11/21] [tesla] renamed channels and their descriptions as suggested on review Signed-off-by: Hakan Tandogan --- .../resources/OH-INF/i18n/tesla.properties | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 dc0b621a6d4b..77f76bdae0bb 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 @@ -105,16 +105,16 @@ thing-type.config.tesla.vehicle.vin.description = VIN of the vehicle # channel types -channel-type.tesla.ar_destination.label = Active route destination -channel-type.tesla.ar_destination.description = The position to which to navigate -channel-type.tesla.ar_location.label = Active route Location -channel-type.tesla.ar_location.description = The actual position of the position to which to navigate -channel-type.tesla.ar_distancetoarrival.label = Active route distance to arrival -channel-type.tesla.ar_distancetoarrival.description = Driving distance to the position to which to navigate -channel-type.tesla.ar_minutestoarrival.label = Active route minutes to arrival -channel-type.tesla.ar_minutestoarrival.description = Driving minutes to the position to which to navigate -channel-type.tesla.ar_trafficminutesdelay.label = Active route traffic minutes delay -channel-type.tesla.ar_trafficminutesdelay.description = Delay due to traffic while driving to the position to which to navigate +channel-type.tesla.destinationname.label = Active route destination +channel-type.tesla.destinationname.description = The position to which to navigate +channel-type.tesla.destinationlocation.label = Active route Location +channel-type.tesla.destinationlocation.description = The actual position of the position to which to navigate +channel-type.tesla.distancetoarrival.label = Active route distance to arrival +channel-type.tesla.distancetoarrival.description = Driving distance to the position to which to navigate +channel-type.tesla.minutestoarrival.label = Active route minutes to arrival +channel-type.tesla.minutestoarrival.description = Driving minutes to the position to which to navigate +channel-type.tesla.trafficminutesdelay.label = Active route traffic minutes delay +channel-type.tesla.trafficminutesdelay.description = Delay due to traffic while driving to the position to which to navigate channel-type.tesla.autoconditioning.label = Auto Conditioning channel-type.tesla.autoconditioning.description = Turns on auto-conditioning (a/c or heating) From 544e642fc17d07f93fe9a7662916eac6f7ad8c35 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:22:14 +0200 Subject: [PATCH 12/21] Update bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/channels.xml Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 47203c0f0d8e..29aae46ba222 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 @@ -19,7 +19,7 @@ Number:Length - Distance to drive to the destination + Distance to drive to the destination (in miles) From 3c84dc878b22a938aad635456405139de2f9b4c1 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:22:47 +0200 Subject: [PATCH 13/21] Update bundles/org.openhab.binding.tesla/README.md Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index 94b370f4c486..6908f93736f2 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -269,7 +269,7 @@ Number:Temperature TeslaInsideTemperature {channel="account:model3:myaccou Number:Temperature TeslaOutsideTemperature {channel="account:model3:myaccount:mycar:outsidetemp"} String TeslaDestinationName {channel="account:model3:myaccount:mycar:destinationname"} -String TeslaDestinationLocation {channel="account:model3:myaccount:mycar:destinationlocation"} +Location TeslaDestinationLocation {channel="account:model3:myaccount:mycar:destinationlocation"} Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:minutestoarrival"} Number:Length TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:distancetoarrival"} ``` From 8abc72062181f9949dc96fdf915d7c582e7666b4 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:23:08 +0200 Subject: [PATCH 14/21] Update bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- .../binding/tesla/internal/TeslaChannelSelectorProxy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e8b1f27e3ebf..c4ddf2498037 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 @@ -46,7 +46,7 @@ public enum TeslaChannelSelector { API("api_version", "api", DecimalType.class, true), AR_DESTINATION("active_route_destination", "destinationname", StringType.class, true), - AR_LATITUDE("active_route_latitude", "ar_location", DecimalType.class, false) { + AR_LATITUDE("active_route_latitude", "destinationlocation", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { proxy.latitude = s; From 099fb1b64b5ee684d4875845758575e35ddf45d6 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:28:32 +0200 Subject: [PATCH 15/21] [tesla] add thingTypeVersion as shown by @jlaur Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/model3.xml | 4 ++++ .../src/main/resources/OH-INF/thing/models.xml | 4 ++++ .../src/main/resources/OH-INF/thing/modelx.xml | 4 ++++ .../src/main/resources/OH-INF/thing/modely.xml | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml index 0a59bd1e5e1e..2a892589c934 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/model3.xml @@ -125,6 +125,10 @@ + + 1 + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml index 9286ec9fb927..2251bdc60477 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/models.xml @@ -131,6 +131,10 @@ + + 1 + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml index 6075712d5459..6d3074a98726 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modelx.xml @@ -131,6 +131,10 @@ + + 1 + + diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml index b8478e6c6321..647d592b928e 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/OH-INF/thing/modely.xml @@ -127,6 +127,10 @@ + + 1 + + From a0b47e0a08812ff153f8ebd9990d426a7ceacca6 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:35:59 +0200 Subject: [PATCH 16/21] [tesla] adapted label case to other examples Signed-off-by: Hakan Tandogan --- .../src/main/resources/OH-INF/thing/channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 29aae46ba222..a24c283e1898 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 @@ -18,7 +18,7 @@ Number:Length - + Distance to drive to the destination (in miles) From 57aa02f708f43e221929fcfefa89407a25469670 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Fri, 6 Oct 2023 23:36:29 +0200 Subject: [PATCH 17/21] [tesla] aligned labels and descriptions with channels.xml Signed-off-by: Hakan Tandogan --- .../resources/OH-INF/i18n/tesla.properties | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 77f76bdae0bb..4a6c81c373db 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 @@ -105,16 +105,16 @@ thing-type.config.tesla.vehicle.vin.description = VIN of the vehicle # channel types -channel-type.tesla.destinationname.label = Active route destination -channel-type.tesla.destinationname.description = The position to which to navigate -channel-type.tesla.destinationlocation.label = Active route Location -channel-type.tesla.destinationlocation.description = The actual position of the position to which to navigate -channel-type.tesla.distancetoarrival.label = Active route distance to arrival -channel-type.tesla.distancetoarrival.description = Driving distance to the position to which to navigate -channel-type.tesla.minutestoarrival.label = Active route minutes to arrival -channel-type.tesla.minutestoarrival.description = Driving minutes to the position to which to navigate -channel-type.tesla.trafficminutesdelay.label = Active route traffic minutes delay -channel-type.tesla.trafficminutesdelay.description = Delay due to traffic while driving to the position to which to navigate +channel-type.tesla.destinationname.label = Route Destination +channel-type.tesla.destinationname.description = Name of the destination +channel-type.tesla.destinationlocation.label = Route Location +channel-type.tesla.destinationlocation.description = Location of the destination +channel-type.tesla.distancetoarrival.label = Distance To Arrival +channel-type.tesla.distancetoarrival.description = Distance to drive to the destination (in miles) +channel-type.tesla.minutestoarrival.label = Minutes To Arrival +channel-type.tesla.minutestoarrival.description = Minutes to drive to the destination +channel-type.tesla.trafficminutesdelay.label = Traffic Delay +channel-type.tesla.trafficminutesdelay.description = Delay to arrive at the destination due to traffic channel-type.tesla.autoconditioning.label = Auto Conditioning channel-type.tesla.autoconditioning.description = Turns on auto-conditioning (a/c or heating) From 51d9e1754d4f25152058868f7beedb58192f0100 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Sat, 7 Oct 2023 10:52:48 +0200 Subject: [PATCH 18/21] Update bundles/org.openhab.binding.tesla/README.md Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index 6908f93736f2..c7a47eac3513 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -92,7 +92,7 @@ Additionally, these advanced channels are available (not all are available on al |---------------------------|--------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------| | destinationname | String | Route destination | Name of the destination | | destinationlocation | Location | Route location | Location of the destination | -| distancetoarrival | Number:Length | Distance to arrival | Distance to drive to the destination | +| distancetoarrival | Number:Length | Distance to arrival | Distance to drive to the destination (in miles) | | minutestoarrival | Number:Time | Minutes to arrival | Minutes to drive to the destination | | trafficminutesdelay | Number:Time | Traffic delay | Minutes of delay due to traffic | | autoparkstate | String | Autopark State | Undocumented / To be defined | From 4575dc762a0b999deff533f6f5e6387e857414ab Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Sat, 7 Oct 2023 10:53:05 +0200 Subject: [PATCH 19/21] Update bundles/org.openhab.binding.tesla/README.md Co-authored-by: Jacob Laursen Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index c7a47eac3513..5972aafc251b 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -270,7 +270,7 @@ Number:Temperature TeslaOutsideTemperature {channel="account:model3:myaccou String TeslaDestinationName {channel="account:model3:myaccount:mycar:destinationname"} Location TeslaDestinationLocation {channel="account:model3:myaccount:mycar:destinationlocation"} -Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:minutestoarrival"} +Number:Time TeslaMinutesToArrival {channel="account:model3:myaccount:mycar:minutestoarrival", unit="min"} Number:Length TeslaDistanceToArrival {channel="account:model3:myaccount:mycar:distancetoarrival"} ``` From 4d346f8d8333aef794104f8e57bc62e16855ccc8 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Sat, 7 Oct 2023 11:00:01 +0200 Subject: [PATCH 20/21] [tesla] updated default sitemap as suggested on review Signed-off-by: Hakan Tandogan --- bundles/org.openhab.binding.tesla/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index 5972aafc251b..86bf7825256f 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -350,9 +350,9 @@ sitemap main label="Main" } Frame { - String item=TeslaDestinationName - Number item=TeslaMinutesToArrival - Number item=TeslaDistanceToArrival + Default item=TeslaDestinationName + Default item=TeslaMinutesToArrival + Default item=TeslaDistanceToArrival Mapview item=TeslaDestinationLocation height=10 } } From 457f70bb47553b19a4a2dcb213606b1c8e485ea3 Mon Sep 17 00:00:00 2001 From: Hakan Tandogan Date: Mon, 9 Oct 2023 12:05:23 +0200 Subject: [PATCH 21/21] [tesla] expose navigation destination as channels instead of properties Signed-off-by: Hakan Tandogan --- .../binding/tesla/internal/TeslaChannelSelectorProxy.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 c4ddf2498037..69ed9afc50e3 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 @@ -45,7 +45,7 @@ public class TeslaChannelSelectorProxy { public enum TeslaChannelSelector { API("api_version", "api", DecimalType.class, true), - AR_DESTINATION("active_route_destination", "destinationname", StringType.class, true), + AR_DESTINATION("active_route_destination", "destinationname", StringType.class, false), AR_LATITUDE("active_route_latitude", "destinationlocation", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { @@ -62,7 +62,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { State someState = super.getState(s); @@ -70,7 +70,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map(value, ImperialUnits.MILE); } }, - AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "minutestoarrival", DecimalType.class, true) { + AR_MINUTES_TO_ARRIVAL("active_route_minutes_to_arrival", "minutestoarrival", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map properties) { State someState = super.getState(s);