Skip to content

Commit

Permalink
Build against Openhab 2.3
Browse files Browse the repository at this point in the history
Also with improved switch channel handling thanks to the research and coding efforts by Mihai Badea
  • Loading branch information
jllcunha authored May 26, 2018
1 parent 47a4a2a commit 137c505
Show file tree
Hide file tree
Showing 32 changed files with 246 additions and 172 deletions.
11 changes: 5 additions & 6 deletions org.openhab.binding.greeair/ESH-INF/binding/binding.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="greeair"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">
<binding:binding id="greeair" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">

<name>GreeAir Binding</name>
<description>A binding for Gree Air Conditioners.</description>
<author>John Cunha</author>
<description>This is the binding for GreeAir.</description>
<author>JLLCunha</author>

</binding:binding>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ thing-type.greeair.sample.description = <Your localized Thing description>

# channel types
channel-type.greeair.sample-channel.label = <Your localized Channel label>
channel-type.greeair.sample-channel.description = <Your localized Channel description>
channel-type.greeair.sample-channel.description = <Your localized Channel description>
103 changes: 19 additions & 84 deletions org.openhab.binding.greeair/ESH-INF/thing/thing-types.xml
Original file line number Diff line number Diff line change
@@ -1,97 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="greeair"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">

<!--The one and only supported thing type-->
<thing-type id="greeairthing">
<label>Gree AirConditioner</label>
<description>Gree AirConditioner</description>
<!-- Sample Thing Type -->
<thing-type id="sample">
<label>GreeAir Binding Thing</label>
<description>Sample thing for GreeAir Binding</description>

<channels>
<channel id="powerchannel" typeId="power-channel"/><channel typeId="mode-channel" id="modechannel"></channel>
<channel typeId="turbo-channel" id="turbochannel"></channel>
<channel typeId="light-channel" id="lightchannel"></channel>
<channel typeId="temp-channel" id="tempchannel"></channel>
<channel typeId="swingvertical-channel" id="swingverticalchannel"></channel>
<channel typeId="windspeed-channel" id="windspeedchannel"></channel>
<channel typeId="air-channel" id="airchannel"></channel>
<channel typeId="dry-channel" id="drychannel"></channel>
<channel typeId="health-channel" id="healthchannel"></channel>
<channel typeId="pwrsav-channel" id="pwrsavchannel"></channel>
<channel id="channel1" typeId="sample-channel" />
</channels>

<config-description>
<parameter name="ipAddress" type="text" required="true">
<label>Network Address</label>
<description>Enter the IP address of the Gree Airconditioner</description>
<context>network-address</context></parameter>
<parameter name="refresh" type="integer" required="true">
<label>Refresh time interval</label>
<description>Refresh time interval in seconds.</description>
<default>1</default>
<parameter name="config1" type="text" required="true">
<label>Sample parameter</label>
<description>This is a sample text configuration parameter.</description>
</parameter>
<parameter name="broadcastAddress" type="text" required="true">
<label>Broadcast Address</label>
<description>Enter the network Broadcast IP for your network</description>
<context>network-address</context>
<default>255.255.255.255</default></parameter></config-description>
</config-description>

</thing-type>

<!--Binding channels-->
<channel-type id="power-channel">
<item-type>Switch</item-type>
<label>Power</label>
<description>Power channel for GreeAir Binding</description>
</channel-type>
<channel-type id="mode-channel">
<item-type>Number</item-type>
<label>Mode</label>
<description>Mode Channel for Gree Air Binding. Mode: Auto: 0, Cool: 1, Dry: 2, Fan: 3, Heat: 4</description>
</channel-type>
<channel-type id="turbo-channel">
<item-type>Switch</item-type>
<label>Turbo</label>
<description>Turbo Fan Channel for Gree Air Ninding</description>
</channel-type>
<channel-type id="light-channel">
<item-type>Switch</item-type>
<label>Light</label>
<description>Light Channel for Gree Air Binding</description>
</channel-type>
<channel-type id="temp-channel">
<item-type>Number</item-type>
<label>Temperature</label>
<description>Temperature Channel for Gree Air Binding</description>
</channel-type>
<channel-type id="swingvertical-channel">
<item-type>Number</item-type>
<label>Vertical Swing</label><description>Vertical Swing Channel for Gree Air Binding. Swing: Full: 1, Up: 2, MidUp: 3, Mid: 4, Mid Down: 5, Down : 6</description>
</channel-type>
<channel-type id="windspeed-channel">
<item-type>Number</item-type>
<label>Fan Speed</label>
<description>Fan Speed Channel for Gree Air binding. Auto:0, Low:1, Midlow:2, Mid:3, MidHigh:4, High:5</description>
</channel-type>
<channel-type id="air-channel">
<item-type>Switch</item-type>
<label>Air</label>
<description>Air Channel for Gree Air Binding</description>
</channel-type>
<channel-type id="dry-channel">
<item-type>Switch</item-type>
<label>Dry</label>
<description>Dry Channel for Gree Air Binding</description>
</channel-type>
<channel-type id="health-channel">
<item-type>Switch</item-type>
<label>Health</label>
<description>Health Channel for Gree Air Binding</description>
</channel-type>
<channel-type id="pwrsav-channel">
<item-type>Switch</item-type>
<label>Power Saving</label>
<description>Pwer Saving Channel for Gree Air Binding</description>
<!-- Sample Channel Type -->
<channel-type id="sample-channel">
<item-type>greeairItem</item-type>
<label>GreeAir Binding Channel</label>
<description>Sample channel for GreeAir Binding</description>
</channel-type>

</thing:thing-descriptions>
5 changes: 1 addition & 4 deletions org.openhab.binding.greeair/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ Bundle-Name: GreeAir Binding
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-SymbolicName: org.openhab.binding.greeair;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.2.0.qualifier
Bundle-Version: 2.3.0.qualifier
Export-Package:
org.openhab.binding.greeair,
org.openhab.binding.greeair.handler
Import-Package:
com.google.gson,
com.google.gson.stream,
org.eclipse.jdt.annotation;resolution:=optional,
org.eclipse.smarthome.config.core,
org.eclipse.smarthome.config.discovery,
org.eclipse.smarthome.core.library.types,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
Expand All @@ -24,6 +22,5 @@ Import-Package:
org.eclipse.smarthome.core.types,
org.openhab.binding.greeair,
org.openhab.binding.greeair.handler,
org.osgi.service.component.annotations;resolution:=optional,
org.slf4j
Service-Component: OSGI-INF/*.xml
1 change: 1 addition & 0 deletions org.openhab.binding.greeair/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ <h3>License</h3>

</body>
</html>

3 changes: 2 additions & 1 deletion org.openhab.binding.greeair/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ bin.includes=META-INF/,\
.,\
OSGI-INF/,\
ESH-INF/,\
about.html
about.html

22 changes: 10 additions & 12 deletions org.openhab.binding.greeair/pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +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 http://maven.apache.org/maven-v4_0_0.xsd">
<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 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.binding</groupId>
<artifactId>pom</artifactId>
<version>2.2.0-SNAPSHOT</version>
</parent>
<parent>
<artifactId>pom</artifactId>
<groupId>org.openhab.binding</groupId>
<version>2.3.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.greeair</artifactId>
<version>2.2.0-SNAPSHOT</version>
<artifactId>org.openhab.binding.greeair</artifactId>
<packaging>eclipse-plugin</packaging>

<name>GreeAir Binding</name>
<packaging>eclipse-plugin</packaging>
<name>GreeAir Binding</name>

</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2010-2017 by the respective copyright holders.
* Copyright (c) 2010-2018 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -8,7 +8,8 @@
*/
package org.openhab.binding.greeair;

import org.eclipse.jdt.annotation.NonNullByDefault;
//import org.eclipse.jdt.annotation.NonNullByDefault;
//import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.smarthome.core.thing.ThingTypeUID;

/**
Expand All @@ -17,7 +18,7 @@
*
* @author John Cunha - Initial contribution
*/
@NonNullByDefault
// @NonNullByDefault
public class GreeAirBindingConstants {

private static final String BINDING_ID = "greeair";
Expand Down
Loading

0 comments on commit 137c505

Please sign in to comment.