forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Weger <[email protected]>
- Loading branch information
1 parent
e9887c3
commit 1d01254
Showing
15 changed files
with
1,629 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>3.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.guntamatic</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: Guntamatic Binding</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.binding.guntamatic/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.guntamatic-${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-guntamatic" description="Guntamatic Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.guntamatic/${project.version}</bundle> | ||
</feature> | ||
</features> |
76 changes: 76 additions & 0 deletions
76
...tic/src/main/java/org/openhab/binding/guntamatic/internal/GuntamaticBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* Copyright (c) 2010-2022 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.guntamatic.internal; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link GuntamaticBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Weger Michael - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class GuntamaticBindingConstants { | ||
|
||
public static final String BINDING_ID = "guntamatic"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_BIOSTAR = new ThingTypeUID(BINDING_ID, "biostar"); | ||
public static final ThingTypeUID THING_TYPE_POWERCHIP = new ThingTypeUID(BINDING_ID, "powerchip"); | ||
public static final ThingTypeUID THING_TYPE_POWERCORN = new ThingTypeUID(BINDING_ID, "powercorn"); | ||
public static final ThingTypeUID THING_TYPE_BIOCOM = new ThingTypeUID(BINDING_ID, "biocom"); | ||
public static final ThingTypeUID THING_TYPE_PRO = new ThingTypeUID(BINDING_ID, "pro"); | ||
public static final ThingTypeUID THING_TYPE_THERM = new ThingTypeUID(BINDING_ID, "therm"); | ||
|
||
// List of all Channel ids | ||
public static final String CHANNEL_CONTROLBOILERAPPROVAL = "controlBoilerApproval"; | ||
public static final String CHANNEL_CONTROLPROGRAM = "controlProgram"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM0 = "controlHeatCircProgram0"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM1 = "controlHeatCircProgram1"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM2 = "controlHeatCircProgram2"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM3 = "controlHeatCircProgram3"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM4 = "controlHeatCircProgram4"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM5 = "controlHeatCircProgram5"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM6 = "controlHeatCircProgram6"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM7 = "controlHeatCircProgram7"; | ||
public static final String CHANNEL_CONTROLHEATCIRCPROGRAM8 = "controlHeatCircProgram8"; | ||
public static final String CHANNEL_CONTROLWWHEAT0 = "controlWwHeat0"; | ||
public static final String CHANNEL_CONTROLWWHEAT1 = "controlWwHeat1"; | ||
public static final String CHANNEL_CONTROLWWHEAT2 = "controlWwHeat2"; | ||
public static final String CHANNEL_CONTROLEXTRAWWHEAT0 = "controlExtraWwHeat0"; | ||
public static final String CHANNEL_CONTROLEXTRAWWHEAT1 = "controlExtraWwHeat1"; | ||
public static final String CHANNEL_CONTROLEXTRAWWHEAT2 = "controlExtraWwHeat2"; | ||
|
||
public static final List<String> CHANNELIDS = Arrays.asList(CHANNEL_CONTROLBOILERAPPROVAL, CHANNEL_CONTROLPROGRAM, | ||
CHANNEL_CONTROLHEATCIRCPROGRAM0, CHANNEL_CONTROLHEATCIRCPROGRAM1, CHANNEL_CONTROLHEATCIRCPROGRAM2, | ||
CHANNEL_CONTROLHEATCIRCPROGRAM3, CHANNEL_CONTROLHEATCIRCPROGRAM4, CHANNEL_CONTROLHEATCIRCPROGRAM5, | ||
CHANNEL_CONTROLHEATCIRCPROGRAM6, CHANNEL_CONTROLHEATCIRCPROGRAM7, CHANNEL_CONTROLHEATCIRCPROGRAM8, | ||
CHANNEL_CONTROLWWHEAT0, CHANNEL_CONTROLWWHEAT1, CHANNEL_CONTROLWWHEAT2, CHANNEL_CONTROLEXTRAWWHEAT0, | ||
CHANNEL_CONTROLEXTRAWWHEAT1, CHANNEL_CONTROLEXTRAWWHEAT2); | ||
|
||
public static final String PARAMETER_BOILERAPPROVAL = "boilerApproval"; | ||
public static final String PARAMETER_PROGRAM = "program"; | ||
public static final String PARAMETER_HEATCIRCPROGRAM = "heatCircProgram"; | ||
public static final String PARAMETER_WWHEAT = "wwHeat"; | ||
public static final String PARAMETER_EXTRAWWHEAT = "extraWwHeat"; | ||
|
||
public static final String DAQDATA_URL = "/daqdata.cgi"; | ||
public static final String DAQDESC_URL = "/daqdesc.cgi"; | ||
public static final String DAQEXTDESC_URL = "/ext/daqdesc.cgi"; | ||
public static final String PARSET_URL = "/ext/parset.cgi"; | ||
} |
62 changes: 62 additions & 0 deletions
62
.../src/main/java/org/openhab/binding/guntamatic/internal/GuntamaticChannelTypeProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Copyright (c) 2010-2022 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.guntamatic.internal; | ||
|
||
import java.util.Collection; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.eclipse.jdt.annotation.Nullable; | ||
import org.openhab.core.thing.type.ChannelType; | ||
import org.openhab.core.thing.type.ChannelTypeBuilder; | ||
import org.openhab.core.thing.type.ChannelTypeProvider; | ||
import org.openhab.core.thing.type.ChannelTypeUID; | ||
import org.openhab.core.thing.type.StateChannelTypeBuilder; | ||
import org.openhab.core.types.StateDescriptionFragmentBuilder; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
/** | ||
* Provide channelTypes for Guntamatic Heating Systems | ||
* | ||
* @author Weger Michael - Initial contribution | ||
*/ | ||
@Component(service = { ChannelTypeProvider.class, GuntamaticChannelTypeProvider.class }) | ||
@NonNullByDefault | ||
public class GuntamaticChannelTypeProvider implements ChannelTypeProvider { | ||
private final Map<String, ChannelType> channelTypes = new ConcurrentHashMap<>(); | ||
|
||
@Override | ||
public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { | ||
return channelTypes.values(); | ||
} | ||
|
||
@Override | ||
public @Nullable ChannelType getChannelType(ChannelTypeUID channelTypeUID, @Nullable Locale locale) { | ||
return channelTypes.get(channelTypeUID.getAsString()); // returns null if not found | ||
} | ||
|
||
public void addChannelType(ChannelTypeUID channelTypeUID, String label, String itemType, String description, | ||
boolean advanced, String pattern) { | ||
StateDescriptionFragmentBuilder stateDescriptionFragmentBuilder = StateDescriptionFragmentBuilder.create() | ||
.withReadOnly(true); | ||
if (!pattern.isEmpty()) { | ||
stateDescriptionFragmentBuilder.withPattern(pattern); | ||
} | ||
StateChannelTypeBuilder stateChannelTypeBuilder = ChannelTypeBuilder.state(channelTypeUID, label, itemType) | ||
.withDescription(description).isAdvanced(advanced) | ||
.withStateDescriptionFragment(stateDescriptionFragmentBuilder.build()); | ||
channelTypes.put(channelTypeUID.getAsString(), stateChannelTypeBuilder.build()); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...amatic/src/main/java/org/openhab/binding/guntamatic/internal/GuntamaticConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright (c) 2010-2022 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.guntamatic.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link GuntamaticConfiguration} class contains fields mapping thing configuration parameters. | ||
* | ||
* @author Weger Michael - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class GuntamaticConfiguration { | ||
|
||
/** | ||
* Configuration parameters | ||
*/ | ||
public String hostname = ""; | ||
public String key = ""; | ||
public int refreshInterval = 60; | ||
public String encoding = "windows-1252"; | ||
} |
Oops, something went wrong.