Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
[opensprinkler] Remove Pi interface (#6290)
Browse files Browse the repository at this point in the history
The Pi interface does not provide all features already implemented in
the binding and will not support features implemented in the future.
Maintaing it is complicated in the current code and doesn't give any
benefit to users.

Fixes #6147

Signed-off-by: Florian <[email protected]>
  • Loading branch information
FlorianSW authored and kaikreuzer committed Oct 27, 2019
1 parent 157247f commit 8aeeb49
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 333 deletions.
16 changes: 1 addition & 15 deletions bundles/org.openhab.binding.opensprinkler/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# OpenSprinkler Binding

This binding allows allows basic control of the OpenSprinkler and OpenSprinkler PI (Plus) devices.
This binding allows allows basic control of the OpenSprinkler devices.
Stations can be controlled to be turned on or off and rain sensor state can be read.

## Supported Bridges

* HTTP (`http`) - The http bridge allows to communicate with an OpenSprinkler device through the network
* Pi (`pi`) - With the pi bridge, openHAB can communicate with an OpenSprinkler device which is installed on the same Pi as the openHAB system.

## Supported Things

Expand Down Expand Up @@ -35,25 +34,12 @@ Bridge opensprinkler:http:http [hostname="127.0.0.1", port=80, pasword="opendoor
- basicUsername: (optional) Only needed when the OpenSprinkler device is behind a basic auth enforcing reverse proxy.
- basicPassword: (optional) Only needed when the OpenSprinkler device is behind a basic auth enforcing reverse proxy.

OpenSprinkler using the Pi interface

```
Bridge opensprinkler:pi:pi [stations=8, refresh=60] {
Thing station 01 [stationIndex=1]
}
```

- stations: Number of stations to control.
- refresh: Number of seconds in between refreshing the Thing state with the API.

### Station Thing Configuration

The `station` thing can be used with both bridge and has the following configuration properties:

- stationIndex: The index of the station to communicate with, starting with 0 for the first station

Be aware, that not all features of a station may be supported by the Pi interface bridge.

## Channels

The following channel is supported by the `station` thing.
Expand Down
10 changes: 0 additions & 10 deletions bundles/org.openhab.binding.opensprinkler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,4 @@
<artifactId>org.openhab.binding.opensprinkler</artifactId>

<name>openHAB Add-ons :: Bundles :: OpenSprinkler Binding</name>

<dependencies>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-core</artifactId>
<version>1.2</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class OpenSprinklerBindingConstants {
public static final ThingTypeUID OPENSPRINKLER_HTTP_BRIDGE = new ThingTypeUID(BINDING_ID, HTTP_BRIDGE);
public static final ThingTypeUID OPENSPRINKLER_STATION = new ThingTypeUID(BINDING_ID, STATION_THING);
public static final ThingTypeUID OPENSPRINKLER_DEVICE = new ThingTypeUID(BINDING_ID, DEVICE_THING);
public static final ThingTypeUID OPENSPRINKLER_PI_BRIDGE = new ThingTypeUID(BINDING_ID, PI_BRIDGE);

public static final int DEFAULT_WAIT_BEFORE_INITIAL_REFRESH = 30;
public static final int DEFAULT_REFRESH_RATE = 60;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiFactory;
import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerDeviceHandler;
import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerHttpBridgeHandler;
import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerPiBridgeHandler;
import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerStationHandler;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
Expand All @@ -42,8 +41,8 @@
*/
@Component(service = ThingHandlerFactory.class, configurationPid = "binding.opensprinkler")
public class OpenSprinklerHandlerFactory extends BaseThingHandlerFactory {
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(Arrays
.asList(OPENSPRINKLER_HTTP_BRIDGE, OPENSPRINKLER_PI_BRIDGE, OPENSPRINKLER_STATION, OPENSPRINKLER_DEVICE));
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(
Arrays.asList(OPENSPRINKLER_HTTP_BRIDGE, OPENSPRINKLER_STATION, OPENSPRINKLER_DEVICE));
private OpenSprinklerApiFactory apiFactory;

@Activate
Expand All @@ -64,8 +63,6 @@ protected ThingHandler createHandler(Thing thing) {
return new OpenSprinklerHttpBridgeHandler((Bridge) thing, this.apiFactory);
} else if (thingTypeUID.equals(OPENSPRINKLER_STATION)) {
return new OpenSprinklerStationHandler(thing);
} else if (thingTypeUID.equals(OPENSPRINKLER_PI_BRIDGE)) {
return new OpenSprinklerPiBridgeHandler((Bridge) thing, this.apiFactory);
} else if (thingTypeUID.equals(OPENSPRINKLER_DEVICE)) {
return new OpenSprinklerDeviceHandler(thing);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

import org.eclipse.jdt.annotation.NonNullByDefault;

import com.pi4j.io.gpio.Pin;
import com.pi4j.io.gpio.RaspiPin;

/**
* The {@link OpenSprinklerApiContents} class defines common constants, which are
* used across OpenSprinkler API classes.
Expand Down Expand Up @@ -50,10 +47,4 @@ public class OpenSprinklerApiConstants {
public static final String JSON_OPTION_STATION_COUNT = "nstations";

public static final String JSON_OPTION_RESULT = "result";

/* These pin-outs are based on the common scheme used by Pi4J and wiringPi. */
public static final Pin SR_CLK_PIN = RaspiPin.GPIO_07; // rev1:4, rev2:4
public static final Pin SR_NOE_PIN = RaspiPin.GPIO_00; // rev1:17, rev2:17
public static final Pin SR_DAT_PIN = RaspiPin.GPIO_02; // rev1:21, rev2:27
public static final Pin SR_LAT_PIN = RaspiPin.GPIO_03; // rev1:22, rev2:22
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,4 @@ public OpenSprinklerApi getHttpApi(OpenSprinklerHttpInterfaceConfig config)
return lowestSupportedApi;
}
}

/**
* Factory method returns an OpenSprnkler PI GPIO class for control.
*
* @param numberOfStations The number of stations to control on the OpenSprinkler PI device.
* @return OpenSprinkler GPIO class for control of the device.
*/
public OpenSprinklerApi getGpioApi(int numberOfStations) {
return new OpenSprinklerGpioApi(numberOfStations);
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8aeeb49

Please sign in to comment.