Skip to content

Commit

Permalink
Merge pull request openhab#3 from paulianttila/melcloud
Browse files Browse the repository at this point in the history
Code review fixes
  • Loading branch information
lucacalcaterra authored Oct 7, 2019
2 parents 1c1f395 + 6a4a110 commit 77589a7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 38 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
/bundles/org.openhab.binding.mail/ @J-N-K
/bundles/org.openhab.binding.max/ @marcelrv
/bundles/org.openhab.binding.mcp23017/ @aogorek
/bundles/org.openhab.binding.melcloud/ @lucacalcaterra @paulianttila
/bundles/org.openhab.binding.meteoblue/ @9037568
/bundles/org.openhab.binding.meteostick/ @cdjackson
/bundles/org.openhab.binding.miele/ @kgoderis
Expand Down
2 changes: 1 addition & 1 deletion bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
<artifactId>org.openhab.binding.mcp23017</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.melcloud</artifactId>
<version>${project.version}</version>
Expand Down
5 changes: 0 additions & 5 deletions bundles/org.openhab.binding.melcloud/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@ https://www.eclipse.org/legal/epl-2.0/.
https://github.com/openhab/openhab2-addons

== Third-party Content

Gson
* License: Apache 2.0 license
* Project: https://github.com/google/gson
* Source: https://github.com/google/gson
28 changes: 14 additions & 14 deletions bundles/org.openhab.binding.melcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,27 +82,27 @@ A.C. device configuration:

A.C. device channels

| Channel | Type | Description | Read Only |
|---------------------|----------|----------------------------------------------------------------------------|-----------|
| power | Switch | Power Status of Device. | False |
| operationMode | Number | Operation mode: 1 = Heat, 2 = Dry, 3 = Cool, 7 = Fan, 8 = Auto. | False |
| setTemperature | Number | Set Temperature: Min = 10, Max = 40. | False |
| fanSpeed | Number | Fan speed: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5. | False |
| vaneHorizontal | Number | Vane Horizontal: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 12 = Swing. | False |
| vaneVertical | Number | Vane Vertical: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 7 = Swing. | False |
| roomTemperature | Number | Room temperature. | True |
| lastCommunication | DateTime | Last Communication time when MELCloud communicated to the device. | True |
| nextCommunication | DateTime | Next communication time when MELCloud will communicate to the device. | True |
| offline | Switch | Is device in offline state. | True |
| hasPendingCommand | Switch | Device has a pending command(s). | True |
| Channel | Type | Description | Read Only |
|---------------------|--------------------|----------------------------------------------------------------------------|-----------|
| power | Switch | Power Status of Device. | False |
| operationMode | Number | Operation mode: 1 = Heat, 2 = Dry, 3 = Cool, 7 = Fan, 8 = Auto. | False |
| setTemperature | Number:Temperature | Set Temperature: Min = 10, Max = 40. | False |
| fanSpeed | Number | Fan speed: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5. | False |
| vaneHorizontal | Number | Vane Horizontal: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 12 = Swing. | False |
| vaneVertical | Number | Vane Vertical: 0 = Auto, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 7 = Swing. | False |
| roomTemperature | Number:Temperature | Room temperature. | True |
| lastCommunication | DateTime | Last Communication time when MELCloud communicated to the device. | True |
| nextCommunication | DateTime | Next communication time when MELCloud will communicate to the device. | True |
| offline | Switch | Is device in offline state. | True |
| hasPendingCommand | Switch | Device has a pending command(s). | True |


## Full Example for items configuration

**melcloud.things**

```
Bridge melcloud:melcloudaccount:myaccount "My MELCloud account" [ username="user.name@email.com", password="xxxxxx", language="0" ] {
Bridge melcloud:melcloudaccount:myaccount "My MELCloud account" [ username="user.name@example.com", password="xxxxxx", language="0" ] {
Thing acdevice livingroom "Livingroom A.C. device" [ deviceID=123456, pollingInterval=60 ]
}
```
Expand Down
18 changes: 9 additions & 9 deletions bundles/org.openhab.binding.melcloud/pom.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
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.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.melcloud</artifactId>
<artifactId>org.openhab.binding.melcloud</artifactId>

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

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void login(String username, String password, int languageId)
if (resp.getErrorId() != null) {
String errorMsg = String.format("Login failed, error code: %s", resp.getErrorId());
if (resp.getErrorMessage() != null) {
errorMsg.concat(String.format(" (%s)", resp.getErrorMessage()));
errorMsg = String.format("%s (%s)", errorMsg, resp.getErrorMessage());
}
throw new MelCloudLoginException(errorMsg);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="melcloud" 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">
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd">

<name>MELCloud Binding</name>
<description>Binding for Mitsubishi MELCloud connected A.C. devices.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="melcloud"
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:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

<thing-type id="acdevice">
<supported-bridge-type-refs>
Expand Down Expand Up @@ -137,13 +137,13 @@
</channel-type>
<channel-type id="offline-channel">
<item-type>Switch</item-type>
<label>Is Offline </label>
<label>Is Offline</label>
<description>Is device in offline state.</description>
<state readOnly="true" />
</channel-type>
<channel-type id="hasPendingCommand-channel">
<item-type>Switch</item-type>
<label>PendingCommand</label>
<label>Pending Command</label>
<description>Device has a pending command(s)</description>
<state readOnly="true" />
</channel-type>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="melcloud"
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:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

<bridge-type id="melcloudaccount">
<label>MELCloud Account</label>
Expand Down

0 comments on commit 77589a7

Please sign in to comment.