Closed kubodhi closed 7 years ago
Just to clarify, it's been working perfectly for the past month or two - absolutely love it! :)
This error just started up within the past week, when I was actually out of state on vacation (but luckily could SSH in and restart the service).
A little more info-
It appears to be the pushbullet implementation, as when I switched to smtp the errors stopped and it's at least running where I can operate the doors now. Sad to be missing the notifications, though. I'll keep poking at it.
The response I'm getting back from pushbullet on the initial push doesn't have an 'iden' key, so the logic for setting door.pb_iden
is breaking. I've commented out that declaration as well as the push deletion bits (since it relies on the door.pb_iden
not being blank) and just have it sending pushes without worrying about cleaning up after itself - and it's working now. Not quite as clean as when I first started using it, but I can't find what changed so this is better than nothing. If anyone has any ideas, I'm all ears. :)
def send_pushbullet(self, door, title, message):
syslog.syslog("Sending pushbutton message")
config = self.config['alerts']['pushbullet']
#if door.pb_iden != None:
# conn = httplib.HTTPSConnection("api.pushbullet.com:443")
# conn.request("DELETE", '/v2/pushes/' + door.pb_iden, "",
# {'Authorization': 'Bearer ' + config['access_token'], 'Content-Type': 'application/json'})
# conn.getresponse()
# door.pb_iden = None
conn = httplib.HTTPSConnection("api.pushbullet.com:443")
conn.request("POST", "/v2/pushes",
json.dumps({
"type": "note",
"title": title,
"body": message,
"channel_tag": "kubo-garagedoor",
}), {'Authorization': 'Bearer ' + config['access_token'], 'Content-Type': 'application/json'})
#door.pb_iden = json.loads(conn.getresponse().read())['iden']
Closing this. I made some changes on my end that may have caused it.
This just started happening this past week, with no changes made to my configuration that I'm aware of. When the service is first launched, everything looks good. The first open event is registered and that's when this error appears. The app continues to run, but subsequent close events are not reported in the status (i.e. door status will always say "open" until the application is restarted).
Any thoughts?