forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[teslascope] Initial contribution (openhab#16956)
* Initial source Signed-off-by: Paul Smedley <[email protected]>
- Loading branch information
Showing
22 changed files
with
2,096 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
This content is produced and maintained by the openHAB project. | ||
|
||
* Project home: https://www.openhab.org | ||
|
||
== Declared Project Licenses | ||
|
||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
|
||
== Source Code | ||
|
||
https://github.com/openhab/openhab-addons |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.addons.reactor.bundles</artifactId> | ||
<version>4.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.teslascope</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: Teslascope Binding</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.binding.teslascope/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.teslascope-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"> | ||
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> | ||
|
||
<feature name="openhab-binding-teslascope" description="Teslascope" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.teslascope/${project.version}</bundle> | ||
</feature> | ||
</features> |
38 changes: 38 additions & 0 deletions
38
.../main/java/org/openhab/binding/teslascope/internal/TeslascopeAuthenticationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.teslascope.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* Exception for when an unexpected response is received from the Teslascope API. | ||
* | ||
* @author Paul Smedley - Initial contribution | ||
* | ||
*/ | ||
@NonNullByDefault | ||
public class TeslascopeAuthenticationException extends Exception { | ||
private static final long serialVersionUID = 529232811860854017L; | ||
|
||
public TeslascopeAuthenticationException(String message) { | ||
super(message); | ||
} | ||
|
||
public TeslascopeAuthenticationException(Throwable ex) { | ||
super(ex); | ||
} | ||
|
||
public TeslascopeAuthenticationException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
105 changes: 105 additions & 0 deletions
105
...ope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.teslascope.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link TeslascopeBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Paul Smedley - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TeslascopeBindingConstants { | ||
|
||
private static final String BINDING_ID = "teslascope"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID TESLASCOPE_THING = new ThingTypeUID(BINDING_ID, "vehicle"); | ||
|
||
// List of all Channel ids | ||
public static final String CHANNEL_VIN = "vin"; | ||
public static final String CHANNEL_VEHICLE_NAME = "vehicle-name"; | ||
public static final String CHANNEL_VEHICLE_STATE = "vehicle-state"; | ||
public static final String CHANNEL_ODOMETER = "odometer"; | ||
public static final String CHANNEL_BATTERY_LEVEL = "battery-level"; | ||
public static final String CHANNEL_CHARGING_STATE = "charging-state"; | ||
public static final String CHANNEL_TPMS_FL = "tpms-pressure-fl"; | ||
public static final String CHANNEL_TPMS_FR = "tpms-pressure-fr"; | ||
public static final String CHANNEL_TPMS_RL = "tpms-pressure-rl"; | ||
public static final String CHANNEL_TPMS_RR = "tpms-pressure-rr"; | ||
public static final String CHANNEL_TPMS_SOFT_WARNING_FL = "tpms-soft-warning-fl"; | ||
public static final String CHANNEL_TPMS_SOFT_WARNING_FR = "tpms-soft-warning-fr"; | ||
public static final String CHANNEL_TPMS_SOFT_WARNING_RL = "tpms-soft-warning-rl"; | ||
public static final String CHANNEL_TPMS_SOFT_WARNING_RR = "tpms-soft-warning-rr"; | ||
public static final String CHANNEL_SOFTWARE_UPDATE_AVAILABLE = "software-update-available"; | ||
public static final String CHANNEL_SOFTWARE_UPDATE_STATUS = "software-update-status"; | ||
public static final String CHANNEL_SOFTWARE_UPDATE_VERSION = "software-update-version"; | ||
public static final String CHANNEL_AUTOCONDITIONING = "auto-conditioning"; | ||
public static final String CHANNEL_BATTERY_RANGE = "battery-range"; | ||
public static final String CHANNEL_CENTER_REAR_SEAT_HEATER = "center-rear-seat-heater"; | ||
public static final String CHANNEL_CHARGE = "charge"; | ||
public static final String CHANNEL_CHARGE_ENERGY_ADDED = "charge-energy-added"; | ||
public static final String CHANNEL_CHARGE_LIMIT_SOC_STANDARD = "charge-limit-soc-standard"; | ||
public static final String CHANNEL_CHARGE_PORT = "charge-port"; | ||
public static final String CHANNEL_CHARGE_RATE = "charge-rate"; | ||
public static final String CHANNEL_CHARGER_POWER = "charger-power"; | ||
public static final String CHANNEL_CHARGER_VOLTAGE = "charger-voltage"; | ||
public static final String CHANNEL_CLIMATE = "climate"; | ||
public static final String CHANNEL_DOOR_LOCK = "door-lock"; | ||
public static final String CHANNEL_DRIVER_FRONT_DOOR = "driver-front-door"; | ||
public static final String CHANNEL_DRIVER_REAR_DOOR = "driver-rear-door"; | ||
public static final String CHANNEL_DRIVER_TEMP = "driver-temp"; | ||
public static final String CHANNEL_ESTIMATED_BATTERY_RANGE = "estimated-battery-range"; | ||
public static final String CHANNEL_FAN = "fan"; | ||
public static final String CHANNEL_FLASH_LIGHTS = "flash-lights"; | ||
public static final String CHANNEL_FRONT_DEFROSTER = "front-defroster"; | ||
public static final String CHANNEL_FRONT_TRUNK = "front-trunk"; | ||
public static final String CHANNEL_HEADING = "heading"; | ||
public static final String CHANNEL_HOMELINK = "homelink"; | ||
public static final String CHANNEL_HONK_HORN = "honk-horn"; | ||
public static final String CHANNEL_INSIDE_TEMP = "inside-temp"; | ||
public static final String CHANNEL_LEFT_REAR_SEAT_HEATER = "left-rear-seat-heater"; | ||
public static final String CHANNEL_LEFT_SEAT_HEATER = "left-seat-heater"; | ||
public static final String CHANNEL_LEFT_TEMP_DIRECTION = "left-temp-direction"; | ||
public static final String CHANNEL_LOCATION = "location"; | ||
public static final String CHANNEL_MIN_AVAILABLE_TEMP = "min-available-temp"; | ||
public static final String CHANNEL_MAX_AVAILABLE_TEMP = "max-available-temp"; | ||
public static final String CHANNEL_OUTSIDE_TEMP = "outside-temp"; | ||
public static final String CHANNEL_PASSENGER_FRONT_DOOR = "passenger-front-door"; | ||
public static final String CHANNEL_PASSENGER_REAR_DOOR = "passenger-rear-door"; | ||
public static final String CHANNEL_PASSENGER_TEMP = "passenger-temp"; | ||
public static final String CHANNEL_POWER = "power"; | ||
public static final String CHANNEL_PRECONDITIONING = "preconditioning"; | ||
public static final String CHANNEL_REAR_DEFROSTER = "rear-defroster"; | ||
public static final String CHANNEL_REAR_TRUNK = "rear-trunk"; | ||
public static final String CHANNEL_RIGHT_REAR_SEAT_HEATER = "right-rear-seat-heater"; | ||
public static final String CHANNEL_RIGHT_SEAT_HEATER = "right-seat-heater"; | ||
public static final String CHANNEL_RIGHT_TEMP_DIRECTION = "right-temp-direction"; | ||
public static final String CHANNEL_SCHEDULED_CHARGING_PENDING = "scheduled-charging-pending"; | ||
public static final String CHANNEL_SCHEDULED_CHARGING_START = "scheduled-charging-start"; | ||
public static final String CHANNEL_SENTRY_MODE = "sentry-mode"; | ||
public static final String CHANNEL_SHIFT_STATE = "shift-state"; | ||
public static final String CHANNEL_SIDE_MIRROR_HEATERS = "side-mirror-heaters"; | ||
public static final String CHANNEL_SMARTPRECONDITIONG = "smart-preconditioning"; | ||
public static final String CHANNEL_SPEED = "speed"; | ||
public static final String CHANNEL_STEERING_WHEEL_HEATER = "steering-wheel-heater"; | ||
public static final String CHANNEL_SUNROOF = "sunroof"; | ||
public static final String CHANNEL_SUNROOF_STATE = "sunroof-state"; | ||
public static final String CHANNEL_TIME_TO_FULL_CHARGE = "time-to-full-charge"; | ||
public static final String CHANNEL_USABLE_BATTERY_LEVEL = "usable-battery-level"; | ||
public static final String CHANNEL_VALET_MODE = "valet-mode"; | ||
public static final String CHANNEL_WIPER_BLADE_HEATER = "wiper-blade-heater"; | ||
} |
39 changes: 39 additions & 0 deletions
39
...c/main/java/org/openhab/binding/teslascope/internal/TeslascopeCommunicationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.teslascope.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
|
||
/** | ||
* Exception for when an unexpected response is received from the Teslascope API. | ||
* | ||
* @author Paul Smedley - Initial contribution | ||
* | ||
*/ | ||
@NonNullByDefault | ||
public class TeslascopeCommunicationException extends Exception { | ||
private static final long serialVersionUID = 529232811860854017L; | ||
|
||
public TeslascopeCommunicationException(String message) { | ||
super(message); | ||
} | ||
|
||
public TeslascopeCommunicationException(Throwable ex) { | ||
super(ex); | ||
} | ||
|
||
public TeslascopeCommunicationException(@Nullable String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.teslascope.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link TeslascopeConfiguration} class contains fields mapping thing configuration parameters. | ||
* | ||
* @author Paul Smedley - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TeslascopeConfiguration { | ||
|
||
public String apiKey = ""; | ||
public String publicID = ""; | ||
public int refreshInterval = 60; | ||
} |
Oops, something went wrong.