Skip to content

Commit

Permalink
v1.0.1 HPM manifest and logging improvements
Browse files Browse the repository at this point in the history
Move logging of mode change request prior to sending to make Abode websocket delays visible
Minor rewording of other log messages
  • Loading branch information
jorhett committed Jul 18, 2020
1 parent 09c0b60 commit 67033c3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
headers:
allow_different_nesting: true
line_length: false
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.

All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)

## 2020-04-25 Release 1.0.1

### Added

- Hubitat Package Manager manifest

### Changed

- Move logging of mode change request prior to sending to make Abode websocket delays visible
- Reformat log messages for easier understanding when debug is disabled.
_Author had never run it with debug logging disabled_. :stuck_out_tongue_winking_eye:

## 2020-04-25 Release 1.0

No changes
Expand Down
16 changes: 8 additions & 8 deletions drivers/AbodeAlarm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ private clearLoginState() {
private changeMode(String new_mode) {
if(new_mode != device.currentValue('gatewayMode')) {
// Only update area 1 since area is not returned in event messages
log.info "Sending request to change Abode gateway mode to ${new_mode}"
reply = doHttpRequest('PUT','/api/v1/panel/mode/1/' + new_mode)
if (reply['area'] == '1') {
log.info "Sent request to change Abode gateway mode to ${new_mode}"
state.localModeChange = new_mode
}
} else {
Expand Down Expand Up @@ -533,7 +533,7 @@ def parseEvent(String event_text) {
break

default:
log.warn "Event ${event_class} has unknown data format: ${event_data}"
log.warn "Abode event ${event_class} has unknown data format: ${event_data}"
message = event_data
break
}
Expand Down Expand Up @@ -582,11 +582,11 @@ def parseEvent(String event_text) {
break

default:
if (logDebug) log.debug "Ignoring Event ${event_class} ${message}"
if (logDebug) log.debug "Ignoring event ${event_class} ${message}"
break
}
} else {
log.warn "Unparseable Event message: ${event_text}"
log.warn "Unparseable Abode event message: ${event_text}"
}
}

Expand Down Expand Up @@ -630,12 +630,12 @@ def parse(String message) {
message_data = packet_data.substring(1)
switch(message_type) {
case '0':
log.info 'webSocket message = Event socket connected'
log.info 'Abode event socket connected'
runInMillis(state.webSocketPingInterval, sendPing)
break

case '1':
log.info 'webSocket message = Event socket disconnected'
log.info 'webSocket message = event socket disconnected'
break

case '2':
Expand Down Expand Up @@ -686,13 +686,13 @@ def webSocketStatus(String message) {
break

case ~/^failure:(.*)$/:
log.warn 'Event socket connection: ' + message
log.warn 'Abode event socket connection: ' + message
state.webSocketConnected = false
state.webSocketConnectAttempt += 1
break

default:
log.warn 'Event socket sent unexpected message: ' + message
log.warn 'Abode event socket sent unexpected message: ' + message
state.webSocketConnected = false
state.webSocketConnectAttempt += 1
}
Expand Down
19 changes: 19 additions & 0 deletions packageManifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"packageName": "Abode Alarm",
"minimumHEVersion": "2.1.0",
"author": "Jo Rhett",
"version": "1.0.1",
"dateReleased": "2020-07-18",
"licenseFile": "https://github.com/jorhett/hubitat-abode/blob/master/LICENSE",
"releaseNotes": "https://github.com/jorhett/hubitat-abode/blob/master/CHANGELOG.md",
"apps" : [],
"drivers" : [
{
"id" : "a3f88dd8-474c-4fe7-a226-521f44638d87",
"name": "Abode Alarm",
"namespace": "jorhett",
"location": "https://raw.githubusercontent.com/jorhett/hubitat-abode/v1.0.1/drivers/AbodeAlarm.groovy",
"required": true
}
]
}

0 comments on commit 67033c3

Please sign in to comment.