From 4316bc154f2d8058626d540957c43e4451ef5aca Mon Sep 17 00:00:00 2001 From: Thorrak Date: Sat, 11 Apr 2020 13:01:11 -0400 Subject: [PATCH 1/5] Add link to Tilt bluetooth debug script to the site help page & tweak formatting --- app/templates/site_help.html | 7 ++++++ .../templates/gravity/gravity_tilt_test.html | 24 +++++++++++-------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/templates/site_help.html b/app/templates/site_help.html index f63ce793..d603eb1d 100644 --- a/app/templates/site_help.html +++ b/app/templates/site_help.html @@ -106,6 +106,13 @@

Other logs

+ +

Other troubleshooting tools

+ +

+ Troubleshoot Tilt/Bluetooth Support +

+ {% endblock %} {% block scripts %}{% endblock %} diff --git a/gravity/templates/gravity/gravity_tilt_test.html b/gravity/templates/gravity/gravity_tilt_test.html index 433aca3a..1b815858 100644 --- a/gravity/templates/gravity/gravity_tilt_test.html +++ b/gravity/templates/gravity/gravity_tilt_test.html @@ -24,10 +24,12 @@

Several system packages are missing.

{% endif %}{# has_apt_packages #} - - - - + + + + + + {% for test_result in apt_test_results %} @@ -86,12 +88,14 @@

Several python packages are missing.

Package NameOK?
Package NameOK?
- - - - - - + + + + + + + + {% for test_result in python_test_results %} From 425f9b45dd159e120292876dc0edd1644be96d03 Mon Sep 17 00:00:00 2001 From: Thorrak Date: Sat, 11 Apr 2020 13:23:02 -0400 Subject: [PATCH 2/5] Add TiltBridge connection information to Tilt management screen --- docs/source/develop/changelog.rst | 1 + .../gravity/gravity_manage_tilt.html | 25 +++++++++++++++ gravity/urls.py | 2 ++ gravity/views.py | 20 +++++++++++- gravity/views_tilt.py | 31 +++++++++++++++++++ 5 files changed, 78 insertions(+), 1 deletion(-) diff --git a/docs/source/develop/changelog.rst b/docs/source/develop/changelog.rst index 04068bd2..f9b7c3a8 100644 --- a/docs/source/develop/changelog.rst +++ b/docs/source/develop/changelog.rst @@ -17,6 +17,7 @@ Added - Store the exact last time that a message was received from a Tilt to Redis - Add sentry support to tilt_monitor_aio.py - Added "debug" scripts for bluetooth Tilt connections +- Added TiltBridge connection settings to Tilt management page diff --git a/gravity/templates/gravity/gravity_manage_tilt.html b/gravity/templates/gravity/gravity_manage_tilt.html index f0f4a2f1..1b7fc374 100644 --- a/gravity/templates/gravity/gravity_manage_tilt.html +++ b/gravity/templates/gravity/gravity_manage_tilt.html @@ -151,6 +151,31 @@

Troubleshoot Tilt Connection

{% endif %} + {% if active_device.tilt_configuration.connection_type == "Bridge" %} +

TiltBridge Configuration

+ +

+ In order for your TiltBridge to communicate with Fermentrack, it needs to be told where Fermentrack can be + reached on your network. If the mDNS ID specified above is correct, this can be done automatically by + Fermentrack, or you can set this manually on the TiltBridge's configuration page. +

+ +
+
+
Package NameRequired VersionInstalled VersionOK?
Package NameRequired VersionInstalled VersionOK?
+ + + + +
Fermentrack URL (copy to TiltBridge){{ fermentrack_url }}
+ + + +

+ Update TiltBridge Automatically +

+ {% endif %} +

- Update TiltBridge Automatically + Update TiltBridge Automatically

{% endif %} From ad600649a38c3e4145f413d85781cd783c299005 Mon Sep 17 00:00:00 2001 From: Thorrak Date: Sat, 11 Apr 2020 13:29:00 -0400 Subject: [PATCH 4/5] Fix TiltBridge ID --- gravity/views_tilt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity/views_tilt.py b/gravity/views_tilt.py index a8d1ff59..0fac4cfc 100644 --- a/gravity/views_tilt.py +++ b/gravity/views_tilt.py @@ -467,9 +467,9 @@ def gravity_tiltbridge_set_url(request, tiltbridge_id, sensor_id=None): # return redirect("/") try: - this_tiltbridge = TiltBridge.objects.get(id=tiltbridge_id) + this_tiltbridge = TiltBridge.objects.get(mdns_id=tiltbridge_id) except ObjectDoesNotExist: - messages.error(request, "Unable to locate TiltBridge with ID {}".format(tiltbridge_id)) + messages.error(request, "Unable to locate TiltBridge with mDNS ID {}".format(tiltbridge_id)) if sensor_id is not None: return redirect("gravity_manage", sensor_id=sensor_id) else: From 3c1747299f0fe3a024ee01a3b4c213ef443b3680 Mon Sep 17 00:00:00 2001 From: Thorrak Date: Sat, 11 Apr 2020 13:44:11 -0400 Subject: [PATCH 5/5] Improve the quality of an error message --- gravity/views_tilt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gravity/views_tilt.py b/gravity/views_tilt.py index 0fac4cfc..6720c2ff 100644 --- a/gravity/views_tilt.py +++ b/gravity/views_tilt.py @@ -481,7 +481,7 @@ def gravity_tiltbridge_set_url(request, tiltbridge_id, sensor_id=None): if this_tiltbridge.update_fermentrack_url_on_tiltbridge(fermentrack_host): messages.success(request, u"Updated Fermentrack URL on TiltBridge '{}'".format(this_tiltbridge.name)) else: - messages.error(request, u"Unable to automatically update Fermentrack URL on TiltBridge {}".format(this_tiltbridge.name)) + messages.error(request, u"Unable to automatically update Fermentrack URL at {}.local".format(this_tiltbridge.mdns_id)) # If we were passed a sensor ID, we want to return to the management screen for that ID. if sensor_id is not None: