Skip to content

Commit

Permalink
Fixed device config schema. Presence conditions should match properly…
Browse files Browse the repository at this point in the history
… as part of rules
  • Loading branch information
mwittig committed Apr 27, 2015
1 parent 22474a2 commit 5babc82
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@ As part of the device definition you need to provide the `host` and `port`for th
* Fixed issue with web server using an untrusted certificate resulting in an "UNABLE_TO_VERIFY_LEAF_SIGNATURE"
error. Untrusted cert will be accepted for now. This feature will be configurable with the next release.
* 20150427, V0.0.6
* Reduced error log output. If "debug" is not set on the plugin, only new error states will be logged
* Reduced error log output. If "debug" is not set on the plugin, only new error states will be logged
* 20150427, V0.0.7
* Fixed device config schema. Presence conditions should match properly as part of rules.
2 changes: 2 additions & 0 deletions device-config-schema.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
title: "HTTP/HTTPS Probe"
description: "Provides a probe for pinging HTTP/HTTPS services"
type: "object"
extensions: ["xLink", "xPresentLabel", "xAbsentLabel"]
properties:
url:
description: "HTTP/HTTPS Service URL to be probed"
Expand Down Expand Up @@ -37,6 +38,7 @@ module.exports = {
title: "TCP Connect Probe"
description: "Provides a probe for a TCP connect to the given host and port"
type: "object"
extensions: ["xLink", "xPresentLabel", "xAbsentLabel"]
properties:
host:
description: "Hostname or IP address of the server"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"device-config-schema.coffee",
"LICENSE"
],
"version": "0.0.6",
"version": "0.0.7",
"homepage": "https://github.com/mwittig/pimatic-probe",
"keywords": [
"pimatic",
Expand Down
7 changes: 3 additions & 4 deletions probe.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ module.exports = (env) ->
@emit "responseTime", value if @config.enableResponseTime

getPresence: ->
@_presence = false if @_presence?
Promise.resolve(@_presence)
Promise.resolve(if @_presence? then @_presence else false)


class TcpConnectProbeDevice extends env.devices.PresenceSensor
Expand Down Expand Up @@ -224,8 +223,8 @@ module.exports = (env) ->
@emit "connectTime", value if @config.enableConnectTime

getPresence: ->
@_presence = false if @_presence?
return Promise.resolve @_presence
Promise.resolve(if @_presence? then @_presence else false)


# ###Finally
# Create a instance of my plugin
Expand Down

0 comments on commit 5babc82

Please sign in to comment.