Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing: Gauge (Angular) Widget Configuration #916

Closed
cj-cuccaro opened this issue Dec 29, 2020 · 4 comments
Closed

Editing: Gauge (Angular) Widget Configuration #916

cj-cuccaro opened this issue Dec 29, 2020 · 4 comments

Comments

@cj-cuccaro
Copy link

I was adding additional color stops that presented me with the following...

Error (Full Traceback):

Traceback (most recent call last):
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_restx/api.py", line 639, in error_router
return original_handler(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_login/utils.py", line 272, in decorated_view
return func(*args, **kwargs)
File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_page.py", line 603, in page_dashboard
utils_dashboard.widget_mod(form_base, request.form)
File "/home/pi/Mycodo/mycodo/mycodo_flask/utils/utils_dashboard.py", line 255, in widget_mod
mod_widget, request_form, custom_options_json_presave, json.loads(custom_options_json_postsave))
File "/home/pi/Mycodo/mycodo/widgets/widget_gauge_angular.py", line 73, in execute_at_modification
current_colors=sorted_colors)
File "/home/pi/Mycodo/mycodo/widgets/widget_gauge_angular.py", line 475, in gauge_reformat_stops
if new_stops > current_stops:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

@kizniche
Copy link
Owner

Please provide detailed steps to reproduce the issue.

@cj-cuccaro
Copy link
Author

1. Go to Default dashboard
2. Add Dashboard Widget
3. Select Gauge (Angular)
4. Set Name – Water pH
5. Select Measurement [Input 02 CH0] Atlas pH Ion Concentration (pH)
6. Set Maximum = 14
7. Click Create
8. Click gear to enter widget configuration
9. Change Stops to 3 – save
10. Click gear to enter widget configuration
11. Change Stops to 28 – save - got weird rendition of gauge
12. Click gear to enter widget configuration
13. Change Stops to 3 – got the following:

Error (Full Traceback):
Traceback (most recent call last):
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_restx/api.py", line 639, in error_router
return original_handler(e)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/pi/Mycodo/env/lib/python3.7/site-packages/flask_login/utils.py", line 272, in decorated_view
return func(*args, **kwargs)
File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_page.py", line 603, in page_dashboard
utils_dashboard.widget_mod(form_base, request.form)
File "/home/pi/Mycodo/mycodo/mycodo_flask/utils/utils_dashboard.py", line 255, in widget_mod
mod_widget, request_form, custom_options_json_presave, json.loads(custom_options_json_postsave))
File "/home/pi/Mycodo/mycodo/widgets/widget_gauge_angular.py", line 73, in execute_at_modification
current_colors=sorted_colors)
File "/home/pi/Mycodo/mycodo/widgets/widget_gauge_angular.py", line 475, in gauge_reformat_stops
if new_stops > current_stops:
TypeError: '>' not supported between instances of 'NoneType' and 'int'

@kizniche
Copy link
Owner

kizniche commented Jan 6, 2021

I couldn't replicate your issue, but I did find other issues with both Angular and Solid gauges that I fixed in the latest commit.

@cj-cuccaro
Copy link
Author

cj-cuccaro commented Jan 6, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants