Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-j-davies committed May 23, 2021
1 parent 3931ad1 commit bdab623
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions HAPRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ function setupRoutes() {
console.log(" Configuring Route : " + RouteNames[i] + " (" + RouteCFG.type + ")")

let RouteClass = new ROUTING.Routes[RouteCFG.type].Class(RouteCFG,(success,message) =>{

if (success === undefined) {
RouteCFG.readyStatus = "<span style=\"color:orange\">Module is initializing...</span>"
} else if (success) {
Expand All @@ -157,9 +156,7 @@ function setupRoutes() {
RouteCFG.readyStatus = "<span style=\"color:tomato\">Module Error: "+message+"</span>"
}
});

Routes[RouteNames[i]] = RouteClass;

}
}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ library, without it, projects like this one are not possible.
## Version History

- **1.5.0**
- Route Module status is now displayed in the Routing UI.
- Route Module status is now displayed in the UI.
- Route Module description added to UI (taken from **package.json**).
- Custom Route Modules now contain a callback in the constructor (driving the status in the UI)
Which can be used to update the the user with the status of the Module.
- Custom Route Modules now contain a callback in the constructor, which can be used to
update the user with the status of the Module.

- **1.4.1**
- Adding an environment variable of **DELAY_ROUTE_SETUP** delays the setup of routes, for the specified milliseconds.
Expand Down
6 changes: 3 additions & 3 deletions RouteModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ The Icon file MUST meet the following spec.
**Color:** White (Transparency is ok - in fact, encouraged, as to not look ugly)

Your class (Exported as **Route**) must have a constructor that accepts an object representing the route settings, as configured in the UI,
and also to store a callback used to update the UI, with the current status of the module.
and also to store a callback used to update the user, with the current status of the module.

The callback method signature(s) are as follows:

| Signature | Meaning |
|--------------------|-------------------------------------------------------------------------|
| (undefined) | Default - Module is initialising |
| (true) | The module (and all of its initialised internals) is ready |
| (false, "Message") | The module is in a faulted state, pass a breif message to explain |
| (true) | The module (and all of its internals) is ready for use |
| (false, "Message") | The module is in a faulted state, pass a brief message to explain |


The class must expose 2 prototype methods: **process** and **close**
Expand Down

0 comments on commit bdab623

Please sign in to comment.