From a48779f4e3866ac9c99e507b4b61daa6eed7cc20 Mon Sep 17 00:00:00 2001 From: Daniel Perna Date: Mon, 9 Jul 2018 01:14:17 +0200 Subject: [PATCH] Allow disabeling notifications --- README.md | 2 +- configurator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34892b3..e07d6a8 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ HTTP requests include the hostname to which the request has been made. To improv #### ENV_PREFIX (string) To modify the default prefix for settings passed as environment variables (`HC_`) change this setting to another value that meets your demands. #### NOTIFY_SERVICE (string) -Define a notification service from your Home Assistant setup that should be used to send notifications, e.g. `notify.mytelegram`. The default is `persistent_notification.create`. Do __NOT__ change the value of the `NOTIFY_SERVICE_DEFAULT` variable! You will be notified if your `HASS_API_PASSWORD`, `SESAME` or `CREDENTIALS` password seems insecure. Additionally a notification with the accessing IP will be sent every time the `SESAME` token has been used for whitelisting. +Define a notification service from your Home Assistant setup that should be used to send notifications, e.g. `notify.mytelegram`. The default is `persistent_notification.create`. Do __NOT__ change the value of the `NOTIFY_SERVICE_DEFAULT` variable! You will be notified if your `HASS_API_PASSWORD`, `SESAME` or `CREDENTIALS` password seems insecure. Additionally a notification with the accessing IP will be sent every time the `SESAME` token has been used for whitelisting. To disable this feature set the value to `False`. __Note regarding `ALLOWED_NETWORKS`, `BANNED_IPS` and `BANLIMIT`__: The way this is implemented works in the following order: diff --git a/configurator.py b/configurator.py index 4a12c84..6179c08 100755 --- a/configurator.py +++ b/configurator.py @@ -4550,7 +4550,7 @@ class SimpleServer(socketserver.ThreadingMixIn, socketserver.TCPServer): def notify(title="HASS Configurator", message="Notification by HASS Configurator", notification_id=None): - if not HASS_API: + if not HASS_API or not NOTIFY_SERVICE: return headers = { "Content-Type": "application/json"