Skip to content

Conversation

@RobinTail
Copy link
Collaborator

* Removing horizontal lines from the logs.

* Removing the plugin name from the log messages.

* Updating the test.

* Changeing the log levels of existing statements.

* Updating the test.

* Similar adjustments to migration scripts.

* Updating the test.

* Adding more debug-level messages.

* Updating the test.

* Minor adjustments to log messages of migrations.

* Fix lint issue.

* Update octoprint_octorelay/__init__.py

* Update octoprint_octorelay/__init__.py

* Apply suggestions from code review

* Update octoprint_octorelay/__init__.py
* New event: TURNED_ON.

* Draft for the implementation.

* no migration

* Updating test_get_settings_defaults.

* Updating test_get_template_vars.

* Mocking and asserting event handler call in test_handle_update_command.

* Ref: moving the stetement into loop.

* Same assertion for test_toggle_relay.

* Ref: another condition for test_handle_update_command.

* Ref: extracting assertion condition.

* Updating snapshot.

* Introducing the scope for handle_plugin_event.

* Using the scope for TURNED_ON event.

* Preventing infinite loop in handle_plugin_event for TURNED_ON and target True.

* Replacing `return` with `continue`

* Add branch logging

* Introducing 'disabled' prop for UI events var structure.

* Disabling the corresponding options in the template.

* Updating snapshot.

* Automatically highlight state label within event label.

* Splitting statements.

* Shortening syntax.

* Shortening syntax.

* Shortening syntax.

* Private naming.

* Revert "Private naming."

This reverts commit 928031c.

* Updating snapshot.

* Add more cases to test_handle_plugin_event.

* Fixed tests.
@RobinTail RobinTail added enhancement New feature or request refactoring Better implementation of the same thing release Chores for releasing new versions labels Aug 16, 2023
@coveralls
Copy link

coveralls commented Aug 16, 2023

Coverage Status

coverage: 100.0%. remained the same when pulling c6b2ef1 on develop into 83911f7 on master.

@RobinTail
Copy link
Collaborator Author

🚀 3.8.0rc1

Revealed:

DEBUG - Finding the upcoming tasks for <filter object at 0x71848a18>

@RobinTail
Copy link
Collaborator Author

Also, an obvious, but interesting thing to fix — the UI update can be triggered twice (by action and by polling).
It needs a lock.

2023-08-16 23:05:21,643 - octoprint.plugins.octorelay - INFO - Received the API command update with parameters: {'pin': 'r3', 'command': 'update'}
2023-08-16 23:05:21,643 - octoprint.plugins.octorelay - DEBUG - Requested to switch the relay r3
2023-08-16 23:05:21,759 - octoprint.plugins.octorelay - DEBUG - Toggling the relay r3 on pin 18
2023-08-16 23:05:21,760 - octoprint.plugins.octorelay - DEBUG - Updating the UI
2023-08-16 23:05:21,799 - octoprint.plugins.octorelay - DEBUG - relay: r3 has changed its pin state
2023-08-16 23:05:21,799 - octoprint.plugins.octorelay - DEBUG - Updating the UI

This is not related to the feature, but improved logging helped to reveal it.

@RobinTail
Copy link
Collaborator Author

✅ QA passed

@RobinTail
Copy link
Collaborator Author

I figured out why this was happening:

#183 (comment)

The iterable being iterated, so for being iterated again it has to be rewind.

Copy link
Collaborator Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready

@RobinTail
Copy link
Collaborator Author

Perhaps I could find how to organize this case better in the future:

Screenshot 2023-08-16 at 23 13 12

Maybe I could combine multiple upcoming events into a single popover

@RobinTail RobinTail merged commit ad5f19b into master Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactoring Better implementation of the same thing release Chores for releasing new versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: organize logging Feature: auto OFF not related to printing

3 participants