Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/openhab/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
coeing committed Feb 7, 2021
2 parents 908b96c + 7269cbf commit 00d2173
Show file tree
Hide file tree
Showing 456 changed files with 20,488 additions and 7,043 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "\U0001F41B Bug report"
name: "🐛 Bug report"
about: Something isn't working correctly with an add-on. This is the wrong place for user-interfaces or openHAB Core issues.
labels: bug

Expand Down
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: 🤔 Support/Usage Question
url: https://community.openhab.org
about: Feel free to ask anything
- name: 📖 Documentation
url: https://openhab.org/addons
about: Official documentation
- name: 📚 Translation feedback
url: https://crowdin.com/project/openhab2-addons
about: Share feedback on translations
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_issue.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "Documentation issue"
name: "📖 Documentation issue"
about: Some information within the add-on documentation is wrong or missing
labels: documentation

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "Feature request"
name: "Feature request"
about: You think that your favorite add-on should gain another feature
labels: enhancement

Expand Down
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/usage_question.md

This file was deleted.

5 changes: 4 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/bundles/org.openhab.binding.bluetooth.daikinmadoka/ @blafois
/bundles/org.openhab.binding.bluetooth.enoceanble/ @pfink
/bundles/org.openhab.binding.bluetooth.generic/ @cpmeister
/bundles/org.openhab.binding.bluetooth.govee/ @cpmeister
/bundles/org.openhab.binding.bluetooth.roaming/ @cpmeister
/bundles/org.openhab.binding.bluetooth.ruuvitag/ @ssalonen
/bundles/org.openhab.binding.boschindego/ @jofleck
Expand Down Expand Up @@ -157,17 +158,19 @@
/bundles/org.openhab.binding.modbus/ @ssalonen
/bundles/org.openhab.binding.modbus.e3dc/ @weymann
/bundles/org.openhab.binding.modbus.helioseasycontrols/ @bern77
/bundles/org.openhab.binding.modbus.sbc/ @fwolter
/bundles/org.openhab.binding.modbus.stiebeleltron/ @pail23
/bundles/org.openhab.binding.modbus.studer/ @giovannimirulla
/bundles/org.openhab.binding.modbus.sunspec/ @mrbig
/bundles/org.openhab.binding.monopriceaudio/ @mlobstein
/bundles/org.openhab.binding.mpd/ @stefanroellin
/bundles/org.openhab.binding.mqtt/ @davidgraeff
/bundles/org.openhab.binding.mqtt.espmilighthub/ @Skinah
/bundles/org.openhab.binding.mqtt.generic/ @davidgraeff
/bundles/org.openhab.binding.mqtt.homeassistant/ @davidgraeff
/bundles/org.openhab.binding.mqtt.homie/ @davidgraeff
/bundles/org.openhab.binding.mystrom/ @pail23
/bundles/org.openhab.binding.nanoleaf/ @raepple
/bundles/org.openhab.binding.nanoleaf/ @raepple @stefan-hoehn
/bundles/org.openhab.binding.neato/ @jjlauterbach
/bundles/org.openhab.binding.neeo/ @tmrobert8
/bundles/org.openhab.binding.neohub/ @andrewfg
Expand Down
15 changes: 15 additions & 0 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@
<artifactId>org.openhab.binding.bluetooth.generic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bluetooth.govee</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.bluetooth.roaming</artifactId>
Expand Down Expand Up @@ -771,6 +776,11 @@
<artifactId>org.openhab.binding.modbus.helioseasycontrols</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.modbus.sbc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.modbus.stiebeleltron</artifactId>
Expand Down Expand Up @@ -801,6 +811,11 @@
<artifactId>org.openhab.binding.mqtt</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.mqtt.espmilighthub</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.mqtt.generic</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.openhab.core.library.types.StringType;
import org.openhab.core.types.RefreshType;
import org.openhab.core.types.State;
import org.openhab.core.types.UnDefType;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
Expand All @@ -73,10 +74,12 @@ public class PIDControllerTriggerHandler extends BaseTriggerModuleHandler implem
private Item setpointItem;
private Optional<String> commandTopic;
private EventFilter eventFilter;
private EventPublisher eventPublisher;

public PIDControllerTriggerHandler(Trigger module, ItemRegistry itemRegistry, EventPublisher eventPublisher,
BundleContext bundleContext) {
super(module);
this.eventPublisher = eventPublisher;

Configuration config = module.getConfiguration();

Expand Down Expand Up @@ -210,7 +213,8 @@ public void receive(Event event) {
if ("RESET".equals(changedEvent.getItemState().toString())) {
controller.setIntegralResult(0);
controller.setDerivativeResult(0);
} else {
eventPublisher.post(ItemEventFactory.createStateEvent(changedEvent.getItemName(), UnDefType.NULL));
} else if (changedEvent.getItemState() != UnDefType.NULL) {
logger.warn("Unknown command: {}", changedEvent.getItemState());
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,67 @@ public class PIDControllerTriggerType extends TriggerType {

public static PIDControllerTriggerType initialize() {
List<ConfigDescriptionParameter> configDescriptions = new ArrayList<>();
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_INPUT_ITEM, Type.TEXT).withRequired(true)
.withReadOnly(true).withMultiple(false).withContext("item").withLabel("Input Item")
.withDescription("Item to monitor").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_SETPOINT_ITEM, Type.TEXT)
.withRequired(true).withReadOnly(true).withMultiple(false).withContext("item").withLabel("Setpoint")
.withDescription("Targeted setpoint").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KP_GAIN, Type.DECIMAL).withRequired(true)
.withMultiple(false).withDefault("1.0").withMinimum(BigDecimal.ZERO).withLabel("Proportional Gain (Kp)")
.withDescription("Change to output propertional to current error value.").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KI_GAIN, Type.DECIMAL).withRequired(true)
.withMultiple(false).withDefault("1.0").withMinimum(BigDecimal.ZERO).withLabel("Integral Gain (Ki)")
.withDescription("Accelerate movement towards the setpoint.").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KD_GAIN, Type.DECIMAL).withRequired(true)
.withMultiple(false).withDefault("1.0").withMinimum(BigDecimal.ZERO).withLabel("Derivative Gain (Kd)")
.withDescription("Slows the rate of change of the output.").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KD_TIMECONSTANT, Type.DECIMAL)
.withRequired(true).withMultiple(false).withMinimum(BigDecimal.ZERO).withDefault("1.0")
.withLabel("Derivative Time Constant")
.withDescription("Slows the rate of change of the D part (T1) in seconds.").withUnit("s").build());
configDescriptions
.add(ConfigDescriptionParameterBuilder.create(CONFIG_COMMAND_ITEM, Type.TEXT).withRequired(false)
.withReadOnly(true).withMultiple(false).withContext("item").withLabel("Command Item")
.withDescription("You can send String commands to this Item like \"RESET\".").build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_LOOP_TIME, Type.DECIMAL)
.withRequired(true).withMultiple(false).withDefault(DEFAULT_LOOPTIME_MS).withLabel("Loop Time")
.withDescription("The interval the output value is updated in ms").withUnit("ms").build());

configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_INPUT_ITEM, Type.TEXT) //
.withRequired(true) //
.withMultiple(false) //
.withContext("item") //
.withLabel("Input Item") //
.withDescription("Item to monitor") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_SETPOINT_ITEM, Type.TEXT) //
.withRequired(true) //
.withMultiple(false) //
.withContext("item") //
.withLabel("Setpoint") //
.withDescription("Targeted setpoint") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KP_GAIN, Type.DECIMAL).withRequired(true) //
.withMultiple(false) //
.withDefault("1.0") //
.withMinimum(BigDecimal.ZERO) //
.withLabel("Proportional Gain (Kp)") //
.withDescription("Change to output propertional to current error value.") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KI_GAIN, Type.DECIMAL) //
.withRequired(true) //
.withMultiple(false) //
.withDefault("1.0") //
.withMinimum(BigDecimal.ZERO) //
.withLabel("Integral Gain (Ki)") //
.withDescription("Accelerate movement towards the setpoint.") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KD_GAIN, Type.DECIMAL) //
.withRequired(true) //
.withMultiple(false) //
.withDefault("1.0") //
.withMinimum(BigDecimal.ZERO) //
.withLabel("Derivative Gain (Kd)") //
.withDescription("Slows the rate of change of the output.") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_KD_TIMECONSTANT, Type.DECIMAL) //
.withRequired(true) //
.withMultiple(false) //
.withMinimum(BigDecimal.ZERO) //
.withDefault("1.0") //
.withLabel("Derivative Time Constant") //
.withDescription("Slows the rate of change of the D part (T1) in seconds.") //
.withUnit("s") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_COMMAND_ITEM, Type.TEXT) //
.withRequired(false) //
.withMultiple(false) //
.withContext("item") //
.withLabel("Command Item") //
.withDescription("You can send String commands to this Item like \"RESET\".") //
.build());
configDescriptions.add(ConfigDescriptionParameterBuilder.create(CONFIG_LOOP_TIME, Type.DECIMAL) //
.withRequired(true) //
.withMultiple(false) //
.withDefault(DEFAULT_LOOPTIME_MS) //
.withLabel("Loop Time") //
.withDescription("The interval the output value is updated in ms") //
.withUnit("ms") //
.build());
Output output = new Output(OUTPUT, BigDecimal.class.getName(), "Output", "Output value of the PID Controller",
null, null, null);
Output pInspector = new Output(P_INSPECTOR, BigDecimal.class.getName(), "P Inspector",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class AmazonDashButtonBindingConstants {
public static final String PRESS = "press";

// Custom Properties
public static final String PROPERTY_MAC_ADDRESS = "macAddress";
public static final String PROPERTY_NETWORK_INTERFACE_NAME = "pcapNetworkInterfaceName";
public static final String PROPERTY_PACKET_INTERVAL = "packetInterval";
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.openhab.binding.amazondashbutton.internal.capturing.PacketCapturingHandler;
import org.openhab.binding.amazondashbutton.internal.capturing.PacketCapturingService;
Expand All @@ -31,6 +29,7 @@
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.config.discovery.DiscoveryService;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingUID;
import org.osgi.service.component.annotations.Component;
import org.pcap4j.core.PcapNetworkInterface;
Expand Down Expand Up @@ -63,7 +62,7 @@ public class AmazonDashButtonDiscoveryService extends AbstractDiscoveryService i
* The Amazon Dash button vendor prefixes
*/
// @formatter:off
private static final Set<String> VENDOR_PREFIXES = Collections.unmodifiableSet(Stream.of(
private static final Set<String> VENDOR_PREFIXES = Set.of(
"F0:D2:F1",
"88:71:E5",
"FC:A1:83",
Expand All @@ -89,7 +88,7 @@ public class AmazonDashButtonDiscoveryService extends AbstractDiscoveryService i
"84:D6:D0",
"34:D2:70",
"B4:7C:9C"
).collect(Collectors.toSet()));
);
// @formatter:on

/**
Expand Down Expand Up @@ -212,8 +211,8 @@ public void packetCaptured(MacAddress macAddress) {
// @formatter:off
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(dashButtonThing)
.withLabel("Dash Button")
.withRepresentationProperty(macAdressString)
.withProperty(PROPERTY_MAC_ADDRESS, macAdressString)
.withRepresentationProperty(Thing.PROPERTY_MAC_ADDRESS)
.withProperty(Thing.PROPERTY_MAC_ADDRESS, macAdressString)
.withProperty(PROPERTY_NETWORK_INTERFACE_NAME, interfaceName)
.withProperty(PROPERTY_PACKET_INTERVAL, BigDecimal.valueOf(5000))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ public void startRoutine(Device device, String utterance)

public @Nullable JsonAutomation @Nullable [] getRoutines()
throws IOException, URISyntaxException, InterruptedException {
String json = makeRequestAndReturnString(alexaServer + "/api/behaviors/automations?limit=2000");
String json = makeRequestAndReturnString(alexaServer + "/api/behaviors/v2/automations?limit=2000");
JsonAutomation[] result = parseJson(json, JsonAutomation[].class);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.avmfritz.internal.dto.DeviceListModel;
Expand Down Expand Up @@ -62,15 +64,16 @@ public void execute(int status, String response) {
logger.trace("Received State response {}", response);
if (isValidRequest()) {
try {
XMLStreamReader xsr = JAXBUtils.XMLINPUTFACTORY.createXMLStreamReader(new StringReader(response));
Unmarshaller unmarshaller = JAXBUtils.JAXBCONTEXT_DEVICES.createUnmarshaller();
DeviceListModel model = (DeviceListModel) unmarshaller.unmarshal(new StringReader(response));
DeviceListModel model = (DeviceListModel) unmarshaller.unmarshal(xsr);
if (model != null) {
handler.onDeviceListAdded(model.getDevicelist());
} else {
logger.debug("no model in response");
}
handler.setStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, null);
} catch (JAXBException e) {
} catch (JAXBException | XMLStreamException e) {
logger.error("Exception creating Unmarshaller: {}", e.getLocalizedMessage(), e);
handler.setStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
e.getLocalizedMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.avmfritz.internal.dto.templates.TemplateListModel;
Expand Down Expand Up @@ -58,14 +60,15 @@ public void execute(int status, String response) {
logger.trace("Received response '{}'", response);
if (isValidRequest()) {
try {
XMLStreamReader xsr = JAXBUtils.XMLINPUTFACTORY.createXMLStreamReader(new StringReader(response));
Unmarshaller unmarshaller = JAXBUtils.JAXBCONTEXT_TEMPLATES.createUnmarshaller();
TemplateListModel model = (TemplateListModel) unmarshaller.unmarshal(new StringReader(response));
TemplateListModel model = (TemplateListModel) unmarshaller.unmarshal(xsr);
if (model != null) {
handler.addTemplateList(model.getTemplates());
} else {
logger.debug("no template in response");
}
} catch (JAXBException e) {
} catch (JAXBException | XMLStreamException e) {
logger.error("Exception creating Unmarshaller: {}", e.getLocalizedMessage(), e);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.stream.XMLInputFactory;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
Expand All @@ -34,6 +35,7 @@ public class JAXBUtils {

public static final @Nullable JAXBContext JAXBCONTEXT_DEVICES = initJAXBContextDevices();
public static final @Nullable JAXBContext JAXBCONTEXT_TEMPLATES = initJAXBContextTemplates();
public static final XMLInputFactory XMLINPUTFACTORY = initXMLInputFactory();

private static @Nullable JAXBContext initJAXBContextDevices() {
try {
Expand All @@ -52,4 +54,11 @@ public class JAXBUtils {
return null;
}
}

private static XMLInputFactory initXMLInputFactory() {
XMLInputFactory xif = XMLInputFactory.newInstance();
xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
return xif;
}
}
13 changes: 13 additions & 0 deletions bundles/org.openhab.binding.bluetooth.govee/NOTICE
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

0 comments on commit 00d2173

Please sign in to comment.