Skip to content

Commit 12a1f76

Browse files
authored
[teslascope] Initial contribution (openhab#16956)
* Initial source Signed-off-by: Paul Smedley <[email protected]>
1 parent 3a5bee0 commit 12a1f76

22 files changed

+2096
-0
lines changed

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
/bundles/org.openhab.binding.tellstick/ @openhab/add-ons-maintainers
372372
/bundles/org.openhab.binding.tesla/ @kgoderis
373373
/bundles/org.openhab.binding.teslapowerwall/ @psmedley
374+
/bundles/org.openhab.binding.teslascope/ @psmedley
374375
/bundles/org.openhab.binding.tibber/ @kjoglum
375376
/bundles/org.openhab.binding.tivo/ @mlobstein
376377
/bundles/org.openhab.binding.touchwand/ @roieg

bom/openhab-addons/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,11 @@
18511851
<artifactId>org.openhab.binding.teslapowerwall</artifactId>
18521852
<version>${project.version}</version>
18531853
</dependency>
1854+
<dependency>
1855+
<groupId>org.openhab.addons.bundles</groupId>
1856+
<artifactId>org.openhab.binding.teslascope</artifactId>
1857+
<version>${project.version}</version>
1858+
</dependency>
18541859
<dependency>
18551860
<groupId>org.openhab.addons.bundles</groupId>
18561861
<artifactId>org.openhab.binding.tibber</artifactId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This content is produced and maintained by the openHAB project.
2+
3+
* Project home: https://www.openhab.org
4+
5+
== Declared Project Licenses
6+
7+
This program and the accompanying materials are made available under the terms
8+
of the Eclipse Public License 2.0 which is available at
9+
https://www.eclipse.org/legal/epl-2.0/.
10+
11+
== Source Code
12+
13+
https://github.com/openhab/openhab-addons

bundles/org.openhab.binding.teslascope/README.md

+242
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.openhab.addons.bundles</groupId>
9+
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
10+
<version>4.3.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>org.openhab.binding.teslascope</artifactId>
14+
15+
<name>openHAB Add-ons :: Bundles :: Teslascope Binding</name>
16+
17+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<features name="org.openhab.binding.teslascope-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
3+
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
4+
5+
<feature name="openhab-binding-teslascope" description="Teslascope" version="${project.version}">
6+
<feature>openhab-runtime-base</feature>
7+
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.teslascope/${project.version}</bundle>
8+
</feature>
9+
</features>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.teslascope.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
17+
/**
18+
* Exception for when an unexpected response is received from the Teslascope API.
19+
*
20+
* @author Paul Smedley - Initial contribution
21+
*
22+
*/
23+
@NonNullByDefault
24+
public class TeslascopeAuthenticationException extends Exception {
25+
private static final long serialVersionUID = 529232811860854017L;
26+
27+
public TeslascopeAuthenticationException(String message) {
28+
super(message);
29+
}
30+
31+
public TeslascopeAuthenticationException(Throwable ex) {
32+
super(ex);
33+
}
34+
35+
public TeslascopeAuthenticationException(String message, Throwable cause) {
36+
super(message, cause);
37+
}
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.teslascope.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
import org.openhab.core.thing.ThingTypeUID;
17+
18+
/**
19+
* The {@link TeslascopeBindingConstants} class defines common constants, which are
20+
* used across the whole binding.
21+
*
22+
* @author Paul Smedley - Initial contribution
23+
*/
24+
@NonNullByDefault
25+
public class TeslascopeBindingConstants {
26+
27+
private static final String BINDING_ID = "teslascope";
28+
29+
// List of all Thing Type UIDs
30+
public static final ThingTypeUID TESLASCOPE_THING = new ThingTypeUID(BINDING_ID, "vehicle");
31+
32+
// List of all Channel ids
33+
public static final String CHANNEL_VIN = "vin";
34+
public static final String CHANNEL_VEHICLE_NAME = "vehicle-name";
35+
public static final String CHANNEL_VEHICLE_STATE = "vehicle-state";
36+
public static final String CHANNEL_ODOMETER = "odometer";
37+
public static final String CHANNEL_BATTERY_LEVEL = "battery-level";
38+
public static final String CHANNEL_CHARGING_STATE = "charging-state";
39+
public static final String CHANNEL_TPMS_FL = "tpms-pressure-fl";
40+
public static final String CHANNEL_TPMS_FR = "tpms-pressure-fr";
41+
public static final String CHANNEL_TPMS_RL = "tpms-pressure-rl";
42+
public static final String CHANNEL_TPMS_RR = "tpms-pressure-rr";
43+
public static final String CHANNEL_TPMS_SOFT_WARNING_FL = "tpms-soft-warning-fl";
44+
public static final String CHANNEL_TPMS_SOFT_WARNING_FR = "tpms-soft-warning-fr";
45+
public static final String CHANNEL_TPMS_SOFT_WARNING_RL = "tpms-soft-warning-rl";
46+
public static final String CHANNEL_TPMS_SOFT_WARNING_RR = "tpms-soft-warning-rr";
47+
public static final String CHANNEL_SOFTWARE_UPDATE_AVAILABLE = "software-update-available";
48+
public static final String CHANNEL_SOFTWARE_UPDATE_STATUS = "software-update-status";
49+
public static final String CHANNEL_SOFTWARE_UPDATE_VERSION = "software-update-version";
50+
public static final String CHANNEL_AUTOCONDITIONING = "auto-conditioning";
51+
public static final String CHANNEL_BATTERY_RANGE = "battery-range";
52+
public static final String CHANNEL_CENTER_REAR_SEAT_HEATER = "center-rear-seat-heater";
53+
public static final String CHANNEL_CHARGE = "charge";
54+
public static final String CHANNEL_CHARGE_ENERGY_ADDED = "charge-energy-added";
55+
public static final String CHANNEL_CHARGE_LIMIT_SOC_STANDARD = "charge-limit-soc-standard";
56+
public static final String CHANNEL_CHARGE_PORT = "charge-port";
57+
public static final String CHANNEL_CHARGE_RATE = "charge-rate";
58+
public static final String CHANNEL_CHARGER_POWER = "charger-power";
59+
public static final String CHANNEL_CHARGER_VOLTAGE = "charger-voltage";
60+
public static final String CHANNEL_CLIMATE = "climate";
61+
public static final String CHANNEL_DOOR_LOCK = "door-lock";
62+
public static final String CHANNEL_DRIVER_FRONT_DOOR = "driver-front-door";
63+
public static final String CHANNEL_DRIVER_REAR_DOOR = "driver-rear-door";
64+
public static final String CHANNEL_DRIVER_TEMP = "driver-temp";
65+
public static final String CHANNEL_ESTIMATED_BATTERY_RANGE = "estimated-battery-range";
66+
public static final String CHANNEL_FAN = "fan";
67+
public static final String CHANNEL_FLASH_LIGHTS = "flash-lights";
68+
public static final String CHANNEL_FRONT_DEFROSTER = "front-defroster";
69+
public static final String CHANNEL_FRONT_TRUNK = "front-trunk";
70+
public static final String CHANNEL_HEADING = "heading";
71+
public static final String CHANNEL_HOMELINK = "homelink";
72+
public static final String CHANNEL_HONK_HORN = "honk-horn";
73+
public static final String CHANNEL_INSIDE_TEMP = "inside-temp";
74+
public static final String CHANNEL_LEFT_REAR_SEAT_HEATER = "left-rear-seat-heater";
75+
public static final String CHANNEL_LEFT_SEAT_HEATER = "left-seat-heater";
76+
public static final String CHANNEL_LEFT_TEMP_DIRECTION = "left-temp-direction";
77+
public static final String CHANNEL_LOCATION = "location";
78+
public static final String CHANNEL_MIN_AVAILABLE_TEMP = "min-available-temp";
79+
public static final String CHANNEL_MAX_AVAILABLE_TEMP = "max-available-temp";
80+
public static final String CHANNEL_OUTSIDE_TEMP = "outside-temp";
81+
public static final String CHANNEL_PASSENGER_FRONT_DOOR = "passenger-front-door";
82+
public static final String CHANNEL_PASSENGER_REAR_DOOR = "passenger-rear-door";
83+
public static final String CHANNEL_PASSENGER_TEMP = "passenger-temp";
84+
public static final String CHANNEL_POWER = "power";
85+
public static final String CHANNEL_PRECONDITIONING = "preconditioning";
86+
public static final String CHANNEL_REAR_DEFROSTER = "rear-defroster";
87+
public static final String CHANNEL_REAR_TRUNK = "rear-trunk";
88+
public static final String CHANNEL_RIGHT_REAR_SEAT_HEATER = "right-rear-seat-heater";
89+
public static final String CHANNEL_RIGHT_SEAT_HEATER = "right-seat-heater";
90+
public static final String CHANNEL_RIGHT_TEMP_DIRECTION = "right-temp-direction";
91+
public static final String CHANNEL_SCHEDULED_CHARGING_PENDING = "scheduled-charging-pending";
92+
public static final String CHANNEL_SCHEDULED_CHARGING_START = "scheduled-charging-start";
93+
public static final String CHANNEL_SENTRY_MODE = "sentry-mode";
94+
public static final String CHANNEL_SHIFT_STATE = "shift-state";
95+
public static final String CHANNEL_SIDE_MIRROR_HEATERS = "side-mirror-heaters";
96+
public static final String CHANNEL_SMARTPRECONDITIONG = "smart-preconditioning";
97+
public static final String CHANNEL_SPEED = "speed";
98+
public static final String CHANNEL_STEERING_WHEEL_HEATER = "steering-wheel-heater";
99+
public static final String CHANNEL_SUNROOF = "sunroof";
100+
public static final String CHANNEL_SUNROOF_STATE = "sunroof-state";
101+
public static final String CHANNEL_TIME_TO_FULL_CHARGE = "time-to-full-charge";
102+
public static final String CHANNEL_USABLE_BATTERY_LEVEL = "usable-battery-level";
103+
public static final String CHANNEL_VALET_MODE = "valet-mode";
104+
public static final String CHANNEL_WIPER_BLADE_HEATER = "wiper-blade-heater";
105+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.teslascope.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
import org.eclipse.jdt.annotation.Nullable;
17+
18+
/**
19+
* Exception for when an unexpected response is received from the Teslascope API.
20+
*
21+
* @author Paul Smedley - Initial contribution
22+
*
23+
*/
24+
@NonNullByDefault
25+
public class TeslascopeCommunicationException extends Exception {
26+
private static final long serialVersionUID = 529232811860854017L;
27+
28+
public TeslascopeCommunicationException(String message) {
29+
super(message);
30+
}
31+
32+
public TeslascopeCommunicationException(Throwable ex) {
33+
super(ex);
34+
}
35+
36+
public TeslascopeCommunicationException(@Nullable String message, Throwable cause) {
37+
super(message, cause);
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.teslascope.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
17+
/**
18+
* The {@link TeslascopeConfiguration} class contains fields mapping thing configuration parameters.
19+
*
20+
* @author Paul Smedley - Initial contribution
21+
*/
22+
@NonNullByDefault
23+
public class TeslascopeConfiguration {
24+
25+
public String apiKey = "";
26+
public String publicID = "";
27+
public int refreshInterval = 60;
28+
}

0 commit comments

Comments
 (0)