Change debugger strategy to try fix debugger being unresponsive issue
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
# I now directly run AppDaemon with debugpy in DockerStart.sh. Not sure which is best
|
||||
# debugger:
|
||||
# module: debugger
|
||||
# class: Debugger
|
||||
# port: 5678
|
||||
debugger:
|
||||
module: debugger
|
||||
class: Debugger
|
||||
priority: 0
|
||||
port: 5678
|
||||
wait_for_client: false # set to true when you need to debug initialize()
|
||||
|
||||
motion_tracker:
|
||||
module: motiontracker
|
||||
|
||||
@@ -5,8 +5,14 @@ import debugpy
|
||||
class Debugger(hass.Hass):
|
||||
def initialize(self):
|
||||
port = int(self.args.get("port", 5678))
|
||||
wait_for_client = bool(self.args.get("wait_for_client", False))
|
||||
try:
|
||||
debugpy.listen(("0.0.0.0", port))
|
||||
self.log(f"debugpy listening on port {port}")
|
||||
except RuntimeError:
|
||||
self.log("debugpy already listening, skipping")
|
||||
|
||||
if wait_for_client:
|
||||
self.log(f"waiting for debug client on port {port}")
|
||||
debugpy.wait_for_client()
|
||||
self.log("debug client attached")
|
||||
|
||||
Reference in New Issue
Block a user