mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +01:00
Compare commits
2 Commits
95781b189f
...
d1fa64fb69
Author | SHA1 | Date | |
---|---|---|---|
|
d1fa64fb69 | ||
|
31c409f6ce |
@ -19,8 +19,28 @@
|
|||||||
<groupId>ro.ciprianpascu</groupId>
|
<groupId>ro.ciprianpascu</groupId>
|
||||||
<artifactId>j2sbus</artifactId>
|
<artifactId>j2sbus</artifactId>
|
||||||
<version>1.5.4</version>
|
<version>1.5.4</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<version>6.0.0</version>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<Import-Package>
|
||||||
|
ro.ciprianpascu.sbus.facade,
|
||||||
|
*
|
||||||
|
</Import-Package>
|
||||||
|
<Embed-Dependency>j2sbus;scope=compile</Embed-Dependency>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -15,7 +15,6 @@ package org.openhab.binding.sbus.handler;
|
|||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import org.openhab.binding.sbus.handler.config.SbusBridgeConfig;
|
import org.openhab.binding.sbus.handler.config.SbusBridgeConfig;
|
||||||
import org.openhab.binding.sbus.internal.SbusServiceImpl;
|
|
||||||
import org.openhab.core.thing.Bridge;
|
import org.openhab.core.thing.Bridge;
|
||||||
import org.openhab.core.thing.ChannelUID;
|
import org.openhab.core.thing.ChannelUID;
|
||||||
import org.openhab.core.thing.ThingStatus;
|
import org.openhab.core.thing.ThingStatus;
|
||||||
@ -69,14 +68,8 @@ public class SbusBridgeHandler extends BaseBridgeHandler {
|
|||||||
"Sbus service not available");
|
"Sbus service not available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
service.initialize(config.host, config.port);
|
||||||
try {
|
updateStatus(ThingStatus.ONLINE);
|
||||||
((SbusServiceImpl) service).initialize(config.host, config.port);
|
|
||||||
updateStatus(ThingStatus.ONLINE);
|
|
||||||
} catch (Exception e) {
|
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -83,4 +83,6 @@ public interface SbusService {
|
|||||||
* Closes the service and releases resources.
|
* Closes the service and releases resources.
|
||||||
*/
|
*/
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
void initialize(String host, int port) throws Exception;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
|
||||||
xsi:schemaLocation="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">
|
https://openhab.org/schemas/thing-description-1.0.0.xsd">
|
||||||
|
|
||||||
<!-- Switch Device -->
|
<!-- Switch Device -->
|
||||||
<thing-type id="switch">
|
<thing-type id="switch">
|
||||||
@ -17,8 +17,10 @@
|
|||||||
<label>SubnetId</label>
|
<label>SubnetId</label>
|
||||||
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
<min>1</min>
|
<options>
|
||||||
<max>255</max>
|
<option value="1">1</option>
|
||||||
|
<option value="255">255</option>
|
||||||
|
</options>
|
||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="id" type="integer" required="true">
|
<parameter name="id" type="integer" required="true">
|
||||||
<label>Device ID</label>
|
<label>Device ID</label>
|
||||||
@ -28,6 +30,7 @@
|
|||||||
<label>Refresh Interval</label>
|
<label>Refresh Interval</label>
|
||||||
<description>Refresh interval in seconds</description>
|
<description>Refresh interval in seconds</description>
|
||||||
<default>30</default>
|
<default>30</default>
|
||||||
|
<unitLabel>s</unitLabel>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
</thing-type>
|
</thing-type>
|
||||||
@ -44,8 +47,10 @@
|
|||||||
<label>SubnetId</label>
|
<label>SubnetId</label>
|
||||||
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
<min>1</min>
|
<options>
|
||||||
<max>255</max>
|
<option value="1">1</option>
|
||||||
|
<option value="255">255</option>
|
||||||
|
</options>
|
||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="id" type="integer" required="true">
|
<parameter name="id" type="integer" required="true">
|
||||||
<label>Device ID</label>
|
<label>Device ID</label>
|
||||||
@ -55,6 +60,7 @@
|
|||||||
<label>Refresh Interval</label>
|
<label>Refresh Interval</label>
|
||||||
<description>Refresh interval in seconds</description>
|
<description>Refresh interval in seconds</description>
|
||||||
<default>30</default>
|
<default>30</default>
|
||||||
|
<unitLabel>s</unitLabel>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
</thing-type>
|
</thing-type>
|
||||||
@ -71,8 +77,10 @@
|
|||||||
<label>SubnetId</label>
|
<label>SubnetId</label>
|
||||||
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
<description>Slave subnet id. Can take any value between 1 and 255. 255 for broadcast.</description>
|
||||||
<default>1</default>
|
<default>1</default>
|
||||||
<min>1</min>
|
<options>
|
||||||
<max>255</max>
|
<option value="1">1</option>
|
||||||
|
<option value="255">255</option>
|
||||||
|
</options>
|
||||||
</parameter>
|
</parameter>
|
||||||
<parameter name="id" type="integer" required="true">
|
<parameter name="id" type="integer" required="true">
|
||||||
<label>Device ID</label>
|
<label>Device ID</label>
|
||||||
@ -82,6 +90,7 @@
|
|||||||
<label>Refresh Interval</label>
|
<label>Refresh Interval</label>
|
||||||
<description>Refresh interval in seconds</description>
|
<description>Refresh interval in seconds</description>
|
||||||
<default>30</default>
|
<default>30</default>
|
||||||
|
<unitLabel>s</unitLabel>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
</thing-type>
|
</thing-type>
|
||||||
@ -114,7 +123,8 @@
|
|||||||
<label>Timer</label>
|
<label>Timer</label>
|
||||||
<description>Timer in seconds to automatically turn off the switch (0 = disabled)</description>
|
<description>Timer in seconds to automatically turn off the switch (0 = disabled)</description>
|
||||||
<default>0</default>
|
<default>0</default>
|
||||||
<min>0</min>
|
<advanced>true</advanced>
|
||||||
|
<unitLabel>s</unitLabel>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
Loading…
Reference in New Issue
Block a user