Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teslascope] Initial contribution #16956

Merged
merged 20 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
/bundles/org.openhab.binding.tellstick/ @openhab/add-ons-maintainers
/bundles/org.openhab.binding.tesla/ @kgoderis
/bundles/org.openhab.binding.teslapowerwall/ @psmedley
/bundles/org.openhab.binding.teslascope/ @psmedley
/bundles/org.openhab.binding.tibber/ @kjoglum
/bundles/org.openhab.binding.tivo/ @mlobstein
/bundles/org.openhab.binding.touchwand/ @roieg
Expand Down
5 changes: 5 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,11 @@
<artifactId>org.openhab.binding.teslapowerwall</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.teslascope</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.tibber</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.teslascope/NOTICE
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
242 changes: 242 additions & 0 deletions bundles/org.openhab.binding.teslascope/README.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions bundles/org.openhab.binding.teslascope/pom.xml
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>
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>
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);
}
}
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";
}
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);
}
}
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;
}
Loading