Skip to content

Commit

Permalink
🚀 3.8.2, #197
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail authored Aug 26, 2023
2 parents 1f04e4f + 41e24d0 commit 996f9ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Version 3

### 3.8.2

- Fixed a bug: the popover on upcoming relay switch could not appear in some cases.
- In case a postponed switch is configured for PRINTING_STARTED or PRINTING_STOPPED event, but no switch is
configured to happen immediately, the UI did not have an update.
- Thanks to [@backupartist](https://github.com/backupartist) for reporting and elaborating to fix this issue.

### 3.8.1

- A couple fixes for the upcoming switch popover:
Expand Down
1 change: 1 addition & 0 deletions octoprint_octorelay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def handle_plugin_event(self, event, scope = RELAY_INDEXES):
self.tasks.append(task)
task.timer.start()
self._logger.debug(f"The task registered: {task}")
self.update_ui() # issue 190

def toggle_relay(self, index, target: Optional[bool] = None):
settings = self._settings.get([index], merged=True) # expensive
Expand Down
3 changes: 3 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ def test_handle_plugin_event(self):
{ "event": "STARTUP", "state": False, "expectedCall": True, "delay": 0 },
]
for case in cases:
self.plugin_instance.update_ui = Mock()
self.plugin_instance.cancel_tasks = Mock()
self.plugin_instance.tasks = []
utilMock.ResettableTimer.reset_mock()
Expand All @@ -652,6 +653,7 @@ def test_handle_plugin_event(self):
case["delay"], self.plugin_instance.toggle_relay, ["r8", case["state"]]
)
timerMock.start.assert_called_with()
self.plugin_instance.update_ui.assert_called_with() # issue 190
self.assertEqual(len(self.plugin_instance.tasks), 8)
for index in range(0,8):
self.assertIsInstance(self.plugin_instance.tasks[index], Task)
Expand All @@ -664,6 +666,7 @@ def test_handle_plugin_event(self):
utilMock.ResettableTimer.assert_not_called()
timerMock.start.assert_not_called()
self.plugin_instance.toggle_relay.assert_not_called()
self.plugin_instance.update_ui.assert_not_called()

def test_cancel_tasks(self):
# Should remove the tasks for the certain relay and cancel its timer
Expand Down

0 comments on commit 996f9ce

Please sign in to comment.