Skip to content

Commit

Permalink
fix restarting from HA
Browse files Browse the repository at this point in the history
  • Loading branch information
pszafer committed Jan 17, 2025
1 parent a1a18b5 commit 99af43c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions boneio/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
)
from boneio.helper.config import ConfigHelper
from boneio.helper.events import EventBus
from boneio.helper.exceptions import ModbusUartException, RestartRequestException
from boneio.helper.exceptions import ModbusUartException
from boneio.helper.gpio import GpioBaseClass
from boneio.helper.loader import (
configure_binary_sensor,
Expand Down Expand Up @@ -871,8 +871,8 @@ async def receive_message(self, topic: str, message: str) -> None:

async def restart_request(self) -> None:
_LOGGER.info("Restarting process. Systemd should restart it soon.")
await self.event_bus.ask_stop()
raise RestartRequestException
import os
os._exit(0) # Terminate the process

@property
def outputs(self) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion boneio/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# flake8: noqa
__version__ = "0.9.0dev13"
__version__ = "0.9.0dev14"

0 comments on commit 99af43c

Please sign in to comment.