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

Improve UI Error on Unknown Flags in Set Flags #313

Merged
merged 2 commits into from
Jan 9, 2021

Conversation

krkeegan
Copy link
Collaborator

@krkeegan krkeegan commented Jan 9, 2021

Exceptions only show up in the LOG. UI, Error, and Warning are sent out to the user UI. I will add some suggestions on logging to the developer instructions.

There was no need to raise an exception here, plus without a LOG message, the user doesn't get very helpful instructions.

Previous:

Commanding dimmer device 12.29.84 (lamp2) cmd=set_flags                                                                 
ERROR: Error running command set_flags on device 12.29.84 (lamp2) 

Now:

Commanding dimmer device 12.29.84 (lamp2) cmd=set_flags                                                                 
ERROR: Unknown Dimmer flags input: {'on-level'}.                                                                         
Valid flags are: {'ramp_rate', 'on_level', 'backlight'}                                                                
Dimmer set_flags complete

This also highlights the need to abstract more of the code. Rather than have to go around to multiple places to fix this, it should only be in one place.

@krkeegan krkeegan merged commit 5355843 into TD22057:dev Jan 9, 2021
@krkeegan krkeegan deleted the Set_Flags_Error branch January 9, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant