Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Provide a trigger for thing Online/Offline status in rule. #3001

Merged
merged 14 commits into from Apr 8, 2017

Commits on Feb 12, 2017

  1. RunEngineImple subscribes to ThingStatusInfoChangedEvent.

    We're going to expose thing status to rule. This is the first step
    toward the goal. The rule engine needs to subscribe to the event.
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    2b3036e View commit details
    Browse the repository at this point in the history
  2. Add a thing syntax in rule.

    The syntax is "Thing <thingUid> changed [from <oldState>] [to <newState>]"
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    0e6ccfe View commit details
    Browse the repository at this point in the history
  3. Expose ThingRegistry in rule.

    Similar to how ItemRegistry is exposedin RulesJvmModelInferrer, ThingRegistry
    is exposed in RulesJvmModelInferrer.xtend
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    9d184d0 View commit details
    Browse the repository at this point in the history
  4. Refactor and add RulesThingRefresher.

    RulesThingsRefresher acts like RulesItemRefresher. It listens to
    things changes (added/removed) and schedules to reload the rules.
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    330bea9 View commit details
    Browse the repository at this point in the history
  5. Infer whether an event trigger is ThingStateChangedEventTrigger.

    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    3b21b2c View commit details
    Browse the repository at this point in the history
  6. RuleEngine listens to ThingStatusChangedEvent and execut the rule.

    Convert the thing status from online to Online which is used in the rule.
    Other thing status are converted to Offline.
    The rule engine also supports the rule with trigger thing state change.
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    12908bf View commit details
    Browse the repository at this point in the history
  7. Support to handle thing state update in rule engine.

    Add the syntax 'Thing' <thingUid> 'received update' in the syntax file. This
    is similar to item status update.
    Handle the thing status event and execute thing update rule in rule engine.
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    d99a8da View commit details
    Browse the repository at this point in the history
  8. Fix issues in thing update/change rules.

    The rule is changed to take thingUid as a string instead of an ID. And we
    don't use the type Thing internally to pass the information in the rule. This
    is done so because when the thing is removed, it can occur before the rule is
    checked and executed. When it occurs, we cannot get the Thing from thingUid.
    Fix an issue in storing thing related rules and retrieve them.
    
    Bug: eclipse-archived#1654
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 12, 2017
    Copy the full SHA
    f9614b7 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2017

  1. Fix a test org.eclipse.smarthome.model.script.tests.

    - Need to add the bundle org.eclipse.smarthome.thing to the plugin in pom.xml.
    
    Signed-off-by: Maoliang Huang <hellomao@outlook.com>
    kceiw committed Feb 20, 2017
    Copy the full SHA
    48b3d50 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2017

  1. Copy the full SHA
    40158b6 View commit details
    Browse the repository at this point in the history
  2. Change thing changed event syntax.

    - Use a pre-defined list as the thing status. the list is the same as
      ThingStatus.
    
    Bug: eclipse-archived#1654
    Signed-off-by: kceiw <hellomao@outlook.com>
    kceiw committed Apr 1, 2017
    Copy the full SHA
    1a55639 View commit details
    Browse the repository at this point in the history
  3. Expose ThingStatusInfo via an action.

    - The thing uid contains ':' which cannot be used as an identifier. So we cannot
      use something like "ThingType:Thing" in the script and interpreset it as a
      thing. So we need to create an action to accept the thing uid and return its
      status.
    - This is to allow the user to create more restrains using ThingStatusInfo in
      the script.
    
    Bug: eclipse-archived#1654
    Signed-off-by: kceiw <hellomao@outlook.com>
    kceiw committed Apr 1, 2017
    Copy the full SHA
    db3e23d View commit details
    Browse the repository at this point in the history
  4. remove org.eclipse.smarthome.core from required package.

    Bug: eclipse-archived#1654
    Signed-off-by: kceiw <hellomao@outlook.com>
    kceiw committed Apr 1, 2017
    Copy the full SHA
    5eeb0e2 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2017

  1. Add missing activate functions in ThingActionService.

    Bug: eclipse-archived#1654
    Signed-off-by: kceiw <hellomao@outlook.com>
    kceiw committed Apr 8, 2017
    Copy the full SHA
    25b04e9 View commit details
    Browse the repository at this point in the history