Salamafet / ophom

Octoprint Philips Hue Outlet Manager
7 stars 1 forks source link

Unintentinal Power-Off on Server Restart #38

Closed rene-mt closed 3 years ago

rene-mt commented 3 years ago

Since I installed Ophom - which for the actual purpose works fine - I have the problem that my Osram/HUE switch is powered off on a restart of Octoprint after installing/updating plug-ins.

Could it be that the plugin receives a Shutdown event in case of a server restart and therefore executes the power-off here:

[...]
elif(event == "Shutdown"):
  if(self._settings.get(['auto_off']) == True):
    self.turn_off()
[...]

(__init__.py)

Salamafet commented 3 years ago

This line was rework by @bitkeeper.

I will see if it is possible to know if an update is in progress to avoid extinction. And sorry for the late response

bitkeeper commented 3 years ago

@rene-mt: Based on the plugin events no difference can be made between a octoprint software restart, system reboot or system shutdown. All will get the "Shutdown" event. Only on system shutdown a power-off is acceptable.

Disable the power off on shutdown in #39 untill clear how to detect the correct situation.

Salamafet commented 3 years ago

Thanks @bitkeeper for the fix.

A new release is out