Commit Graph

105 Commits

Author SHA1 Message Date
Wouter Born
7579aa4d31
Fix more SAT findings and add a few suppressions (#2335)
* Fix more SAT findings and add a few suppressions

Signed-off-by: Wouter Born <github@maindrain.net>
2021-05-05 20:59:59 +02:00
Thomas Weißschuh
9663060943
[automation] match on complete channel UID (#2337)
Matching only on "topic.contains(channelUID)" will lead to false
positivies.

This was reported for the linuxinput binding, where pressing the "left"
key would also trigger rules for the "l" key.

The channels for these are
`linuxinput:input-device:test:keypresses#KEY_L` and
`linuxinput:input-device:test:keypresses#KEY_LEFT`

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2021-05-04 10:49:44 +02:00
Wouter Born
05b7ec86f1
Fix new SAT findings (#2291)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-04-14 18:41:07 +02:00
Sönke Küper
db488d861e
[automation] Added rule rest endpoint and backend operation for rule execution simulation (#2125)
* Added marker interface for TriggerHandler to indicate if they are time based and thus can be used to simulate execution times.
* Added marker interface for ConditionHandler to indicate, if they are time based and thus can be checked during rule execution for a certain time.
* Moved CronAdjuster to common, so it can be used for the rule simulation
* Created RuleExecutionSimulator that allows simulation of rules
* Added method in RuleManger to create simulation
* Added rest endpoint for rule simulation.
* Changed marker interface to return TemporalAdjuster instead of cron expression. This better hides the internals of the TriggerHandler (i.e. the cron expression) and is more clear and flexible for other handlers to implement

Fixes #2044
Fixes #2266

Signed-off-by: Sönke Küper <soenkekueper@gmx.de>
2021-04-11 09:31:48 +02:00
Christoph Weitkamp
7907f48735
Added nullness annotations to TypeParser (#2181)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2021-02-07 09:47:27 +01:00
Sönke Küper
65218f81fc
Added rule condition for not a holiday (#2043)
Signed-off-by: Sönke Küper <soenkekueper@gmx.de>
2021-02-06 16:37:29 +01:00
Wouter Born
46666eb169
Fix deprecations (#2163)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-30 12:22:31 +01:00
Wouter Born
774b9d607b
Update license headers to 2021 (#2041)
Signed-off-by: Wouter Born <github@maindrain.net>
2021-01-01 16:43:46 +01:00
Wouter Born
bf14e1077f
Apply Spotless, resolve itest runbundles for 3.1.0 (#1982)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-12-22 10:01:42 +01:00
jenkins
965531696b [unleash-maven-plugin] Preparation for next development cycle. 2020-12-20 22:24:39 +00:00
Christoph Weitkamp
f83fc07c6a
[automation] Added ItemStateUpdate action (#1970)
* Added ItemUpdate action

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-20 13:53:09 +01:00
Kai Kreuzer
8f13b99122
[automation] Correctly trigger rules with start level 50 trigger (#1962)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 22:07:19 +01:00
Kai Kreuzer
4a108e5c80
Reintroduce delayed rule initialization (#1960)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-18 20:04:28 +01:00
Kai Kreuzer
5d87c1def4
[automation] Fixed startup rules being triggered more than once
Fixes #1943 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 23:21:47 +01:00
Christoph Weitkamp
d37fa48da4
Temporarily hide ThingAction in UIs (#1947)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-12-16 23:21:27 +01:00
Kai Kreuzer
2b9f890831
Stabelized automation integration test (#1944)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-16 14:13:04 +01:00
Kai Kreuzer
8290306348
Fixed SAT issues (#1925)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 13:17:35 +01:00
Kai Kreuzer
313fb496ce
Added config options for start level trigger (#1923)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:34 +01:00
Kai Kreuzer
1a2c81d9e2
Improved startup logging and avoid scripts being loaded in start level service thread (#1919)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-13 09:31:09 +01:00
Kai Kreuzer
076ac3fe15
Implemented start level service (#1914)
Fixes #1637
Fixes #1777
Fixes #1734
Fixes #1823
Fixes #1808

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-12 14:34:37 +01:00
Kai Kreuzer
f99135ae3d
Reverted the introduction of an automation threadpool (#1890)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-12-05 11:50:16 +01:00
Kai Kreuzer
a892c7bcac
Synchronize the executions of each rule (#1870)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-30 10:31:33 +01:00
Kai Kreuzer
575f744a43
Request automation thread pool as a scheduled pool (#1869)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-30 10:18:56 +01:00
Kai Kreuzer
1e2fd7b447
Make rule engine use a threadpool (#1857)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-29 10:56:01 +01:00
Kai Kreuzer
48209e4a45
[automation] Fixes NPE when no command is given in a member-of-group trigger (#1806)
Fixes #1793 

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-11-11 16:27:31 +01:00
Christoph Weitkamp
0b239692ce
Added NPE checks for result of 'getSymbolicName()' methods (#1795)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-11-10 22:36:21 +01:00
Wouter Born
2f2bfde500
Remove Map null annotation workarounds (#1780)
These workarounds to prevent false positives can be removed now the EEAs allow for proper null analysis.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-03 22:12:22 +01:00
Wouter Born
0281c10036
[infrastructure] add external null-annotations (#1775)
Add EEAs and fix null analysis errors.

Related to:

* #888
* openhab/openhab-addons#8848

Signed-off-by: Wouter Born <github@maindrain.net>
2020-11-03 21:33:48 +01:00
Christoph Weitkamp
dd92288e97
Added nullness annotations, ctor injection (#1747)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-24 10:08:38 +02:00
Christoph Weitkamp
7d70a97b77
Fixed IndexOutOfBoundsException in ScriptModuleTypeProvider (#1730)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-10-19 13:41:58 +02:00
Wouter Born
0d1a15ef34
Update ActionService and ThingActions classes in Xtext cache (#1714)
Xtext uses a cache for looking up classes when rules are run.
It also adds a null class value to this cache when a class is not found.

Once a value has entered the cache it will not be updated.
This causes the cache to return the wrong class (or the null value) when
calling static methods on ActionService and ThingActions classes that
were added/updated.

With the changes in this PR Xtext will be configured to use a custom cache
that updates the ActionService and ThingActions class references.

The PR also has a fix for the AnnotatedThingActionModuleTypeProvider not
properly sending ModuleType removed events when all ThingActions
registrations have been removed.

Fixes #1265
Fixes #1694

Signed-off-by: Wouter Born <github@maindrain.net>
2020-10-13 23:17:57 +02:00
Wouter Born
81e82e7d44
Use consistent capitalization with Conditions, Triggers, Actions (#1647)
Fixes #1639

Signed-off-by: Wouter Born <github@maindrain.net>
2020-09-15 19:52:35 +02:00
Łukasz Dywicki
7652d04ff6 Remove dependencies which are not present in the project. (#1592)
These cause build to fail with clean repository.

Signed-off-by: Łukasz Dywicki <luke@code-house.org>
2020-09-03 20:33:32 +02:00
Wouter Born
057604cc2d
Use new Collection API methods (#1598)
Using the new methods there will be less and more readable code.

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-22 23:04:11 +02:00
Wouter Born
d5529f0c1b
Fix various deprecations (#1595)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-15 10:54:41 +02:00
Wouter Born
7300734585
Use "openhab" event topic prefix (#1587)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-11 21:16:49 +02:00
Wouter Born
d3ea6063c0
Migrate to JUnit 5 (#1580)
* Migrates all tests to the JUnit 5 Jupiter API
* Updates bnd to 5.1.2
* Updates maven-surefire-plugin to 3.0.0-M5
* Updates Mockito to 3.4.6
* Updates Hamcrest to 2.2
* Removes org.openhab.core.boot POM dependencies

Signed-off-by: Wouter Born <github@maindrain.net>
2020-08-09 14:36:46 +02:00
Kai Kreuzer
0f134996f2
removed boot bundle (#1559)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-07-24 13:11:56 +02:00
Paul Vogel
ed21001891
Cleanup tests: Simplify assertEquals with boolean to assertTrue or assertFalse (#1567)
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-23 22:19:00 +02:00
Christoph Weitkamp
c747f7f9bb
Fixed removal / replacement of annotated ThingActions (#1536)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-07-21 19:44:55 +02:00
Paul Vogel
27dcce5207
Replace for-loops and iterators with foreach-loops (#1561)
Signed-off-by: Paul Vogel <pavog@users.noreply.github.com>
2020-07-21 17:40:29 +02:00
Christoph Weitkamp
68405036f1
Removed 'Calendar' leftovers (#1522)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-06-14 17:13:28 +02:00
Kai Kreuzer
1fdede0f61
[automation] Removed superfluous file
- Removed superfluous file

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-06-08 12:40:06 +02:00
Kai Kreuzer
840335bbd5
[automation] Moved constants to top and made them public for reference (#1513)
* Moved constants to top and made them public for reference

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-06-07 23:03:53 +02:00
Kai Kreuzer
d265e16e67
[automation] Added group and system triggers to automation component (#1509)
* Added group and system triggers to automation component

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-06-04 07:24:42 +02:00
Christoph Weitkamp
3eb93bf13a
Removed deprecated constructors and methods from Config API (#1448)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-05-20 22:16:54 +02:00
Wouter Born
f3508e4775
Use constructor injection and update null annotations (#1487)
* Use constructor injection and update null annotations

Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-20 17:29:18 +02:00
Wouter Born
84d9438737
Add null annotations to REST resources (#1475)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-05-17 19:32:35 +02:00
aisebastian
aca4513601
This patch adds more robust value comparison in the rule engine (#1456)
Previously, the state values were compared only if the item state was instanceof DecimalType
which did not work for channels that had a dimension specifier, such as Type:Length. The itemState
instance was of type QuantityType<Quantity<BigDecimal>> and therefore was never compared in the rules

Signed-off-by: Sebastian Irimia <aisebastian@yahoo.com>
2020-05-04 21:58:39 +02:00
Christoph Weitkamp
30839ac487
[automation] Fixed creation of 'EphemerisConditionHandler' (#1453)
* Fixed creation of EphemerisConditionHandler

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-05-02 14:08:11 +02:00