You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
经过两小时的调试,终于成功在 Dev Containers 运行并断点小米集成。下面提供简要流程,希望可以帮到大家~
以下操作均在 macOS 15.2 / Visual Studio Code 1.96.0 / OrbStack 1.9.2 完成,其他系统(环境、软件)可参考摸索:
mkdir -p ~/Documents/GitHub
// 创建目录,可自定义cd ~/Documents/GitHub
// 进入目录git clone https://github.com/home-assistant/core home-assistant/core
// 克隆 Home Assistant 到本地git clone https://github.com/XiaoMi/ha_xiaomi_home XiaoMi/ha_xiaomi_home
// 克隆小米智能到本地code home-assistant/core
// 使用 Visual Studio Code 打开 Home Assistant 项目home-assistant/core/.devcontainer/devcontainer.json
文件 // 此时不要直接构建 Dev 容器runArgs
数组的末尾增加"--network=host"
命令 // 允许容器直接使用宿主机的网络(包括局域网)"mounts": ["source=${localEnv:HOME}/Documents/GitHub/XiaoMi/ha_xiaomi_home/custom_components/xiaomi_home,target=${containerWorkspaceFolder}/config/custom_components/xiaomi_home,type=bind"]
字段,与runArgs
同层级 // source 目录可自定义,target 不可修改home-assistant/core/Dockerfile.dev
文件apt-get install
末尾增加iputils-ping
// 使用 ping 命令⇧+⌘+P
呼出命令面板,执行Rebuild Container
命令构建 Dev 容器http://localhost:8123
打开 Home Assistant 网页Beta Was this translation helpful? Give feedback.
All reactions