Change debugger strategy to try fix debugger being unresponsive issue
This commit is contained in:
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
@@ -12,6 +12,7 @@
|
|||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 5678
|
"port": 5678
|
||||||
},
|
},
|
||||||
|
"steppingResumesAllThreads": true,
|
||||||
"pathMappings": [
|
"pathMappings": [
|
||||||
{
|
{
|
||||||
"localRoot": "${workspaceFolder}",
|
"localRoot": "${workspaceFolder}",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ appdaemon:
|
|||||||
longitude: 0
|
longitude: 0
|
||||||
elevation: 30
|
elevation: 30
|
||||||
time_zone: Europe/Berlin
|
time_zone: Europe/Berlin
|
||||||
|
internal_function_timeout: 00:20:00
|
||||||
exclude_dirs:
|
exclude_dirs:
|
||||||
- unit_tests
|
- unit_tests
|
||||||
plugins:
|
plugins:
|
||||||
@@ -11,6 +12,8 @@ appdaemon:
|
|||||||
ha_url: http://10.0.0.21:8123
|
ha_url: http://10.0.0.21:8123
|
||||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiZThhYWI2ZTlkNmQ0NWU2YTk1ODU5OWJjOWM3MWJkYiIsImlhdCI6MTc3NjEwOTc0NCwiZXhwIjoyMDkxNDY5NzQ0fQ.BorkjFjWlWCZqnUa9-NMUxGsDiupDoRZ3cEgsmeSofM
|
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiZThhYWI2ZTlkNmQ0NWU2YTk1ODU5OWJjOWM3MWJkYiIsImlhdCI6MTc3NjEwOTc0NCwiZXhwIjoyMDkxNDY5NzQ0fQ.BorkjFjWlWCZqnUa9-NMUxGsDiupDoRZ3cEgsmeSofM
|
||||||
cert_verify: True
|
cert_verify: True
|
||||||
|
q_timeout: 1200
|
||||||
|
ws_timeout: 00:10:00
|
||||||
http:
|
http:
|
||||||
url: http://0.0.0.0:5050
|
url: http://0.0.0.0:5050
|
||||||
admin:
|
admin:
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# I now directly run AppDaemon with debugpy in DockerStart.sh. Not sure which is best
|
debugger:
|
||||||
# debugger:
|
module: debugger
|
||||||
# module: debugger
|
class: Debugger
|
||||||
# class: Debugger
|
priority: 0
|
||||||
# port: 5678
|
port: 5678
|
||||||
|
wait_for_client: false # set to true when you need to debug initialize()
|
||||||
|
|
||||||
motion_tracker:
|
motion_tracker:
|
||||||
module: motiontracker
|
module: motiontracker
|
||||||
|
|||||||
@@ -5,8 +5,14 @@ import debugpy
|
|||||||
class Debugger(hass.Hass):
|
class Debugger(hass.Hass):
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
port = int(self.args.get("port", 5678))
|
port = int(self.args.get("port", 5678))
|
||||||
|
wait_for_client = bool(self.args.get("wait_for_client", False))
|
||||||
try:
|
try:
|
||||||
debugpy.listen(("0.0.0.0", port))
|
debugpy.listen(("0.0.0.0", port))
|
||||||
self.log(f"debugpy listening on port {port}")
|
self.log(f"debugpy listening on port {port}")
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
self.log("debugpy already listening, skipping")
|
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