snapcraft.yaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. name: home-assistant-snap
  2. title: Home assistant
  3. version: '2022.4.7'
  4. icon: snap/gui/home-assistant-snap.svg
  5. summary: Open source home automation that puts local control and privacy first
  6. description: |
  7. Home Assistant is a free and open-source software for home automation that is designed to be the central control system for smart home devices with focus on local control and privacy.
  8. It can be accessed via a web-based user interface, via companion apps for Android and iOS, or using voice commands via a supported virtual assistant like Google Assistant or Amazon Alexa.
  9. Home Assistant integrates with over a thousand different devices and services.
  10. Read more about Home Assistant at
  11. - https://en.wikipedia.org/wiki/Home_Assistant
  12. - https://www.home-assistant.io/
  13. **NOTE!** This is Home Assistant Core (not Supervised).
  14. Your new installation will be available through your browser at http://localhost:8123/ (or any other IP address where this packages is installed). You will get a launcher available in your application menu on desktops.
  15. **Important information about updates**
  16. Each major versions of Home Assistant might bring breaking changes so you will **only** auto-update for minor releases. Each major release must be upgraded manually by switching channel.
  17. See available channels in the software center or with
  18. `snap info home-assistant-snap`
  19. Please use the stable versions, e.g `2021.8/stable`.
  20. You can switch channel with:
  21. ```
  22. $ snap switch home-assistant-snap --channel=<channel>
  23. ```
  24. where `<channel>` could be `2021.8/stable`.
  25. There is a binary sensor `binary_sensor.updater` that will flip to `true` whenever there are updates available in a newer channel. Use this to show a notification whenever a new major release is available.
  26. **Need help?**
  27. Please use https://www.home-assistant.io/docs/ for documentation and https://community.home-assistant.io for help.
  28. **Necessary plugs**
  29. See `snap connections home-assistant-snap` for necessary plugs (such as access to USB, removable media etc) and connect them with
  30. `$ snap connect home-assistant-snap:<plug>`
  31. where `<plug>` can be in example `raw-usb` (needed for Zigbee, Z-wave and other USB dongles).
  32. **Required plugs**
  33. - *network-control:* enables the configuration of networking and network namespaces via `ip netns`, providing a wide, privileged access to networking. This is required for the DHCP discovery integration to work which will watch the network for DHCP requests for supported devices and services. To disable this feature you will have to disable the `default_config` from you `configuration.yaml` and disconnect the `network-control` plug with `snap disconnect home-assistant-snap:network-control`.
  34. **NOTE!** Removing the `default_config` will require you to build up a whole new configuration for Home Assistant. More on what is enabled by default at this link: https://www.home-assistant.io/integrations/default_config/
  35. **Optional plugs**
  36. - *raw-usb:* allows access to all connected USB devices via a raw interface.
  37. - *removable-media*: allows read/write access to mounted removable storage in /media, /run/media and /mnt.
  38. - *serial-port*: enables access to a specific serial port. This interface is restricted because it provides privileged access to configure serial port hardware. Might require hot-plug support `snap set system experimental.hotplug=true` followed by `systemctl restart snapd`.
  39. - *hardware-observe*: required to use the `usb` discovery component.
  40. **Available slots**
  41. - *components:* Load custom components to Home Assistant. You will find the Home Assistant Community Store package here: https://snapcraft.io/home-assistant-hacs - Installations on own risk and note that provided integrations are not tested or guaranteed to work.
  42. - *bin:* Missing binaries might be in the Home Assistant Toolbox, such as cURL etc. See https://snapcraft.io/home-assistant-toolbox
  43. - *configurations:* Edit your configuration files with `code-server` (VS Code) or HASS configurator:
  44. - https://snapcraft.io/code-server
  45. - https://snapcraft.io/home-assistant-configurator.
  46. # source-code: "https://github.com/home-assistant-snap/home-assistant-snap"
  47. # website: "https://github.com/home-assistant-snap/home-assistant-snap"
  48. # issues: "https://github.com/home-assistant-snap/home-assistant-snap/issues"
  49. # donation: "https://www.paypal.com/donate/?hosted_button_id=69NA8SXXFBDBN"
  50. license: Apache-2.0
  51. base: core20
  52. grade: stable
  53. confinement: strict
  54. architectures:
  55. - build-on: amd64
  56. - build-on: arm64
  57. - build-on: armhf
  58. - build-on: ppc64el
  59. layout:
  60. /usr/local/lib:
  61. bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}
  62. /etc/pip.conf:
  63. bind-file: $SNAP_COMMON/pip.conf
  64. /etc/openzwave:
  65. bind: $SNAP/openzwave
  66. /etc/ethertypes:
  67. bind-file: $SNAP/etc/ethertypes
  68. /etc/protocols:
  69. bind-file: $SNAP/etc/protocols
  70. /etc/services:
  71. bind-file: $SNAP/etc/services
  72. plugs:
  73. bin:
  74. interface: content
  75. content: executables
  76. target: $SNAP/shared-bin
  77. slots:
  78. components:
  79. interface: content
  80. content: components
  81. write:
  82. - $SNAP_DATA/custom_components
  83. # read:
  84. # - $SNAP_DATA/home-assistant.log
  85. configurations:
  86. interface: content
  87. write:
  88. - $SNAP_DATA
  89. vscs-content:
  90. interface: content
  91. write:
  92. - $SNAP_DATA
  93. apps:
  94. home-assistant-snap:
  95. command: bin/hass --config $SNAP_DATA
  96. command-chain:
  97. - bin/snapcraft-preload
  98. - bin/plug-bin
  99. daemon: simple
  100. environment:
  101. PIP_USER: 1
  102. #PYTHONPATH: "$PYTHONPATH:$SNAP/lib/python3.9/site-packages"
  103. restart-condition: always
  104. plugs:
  105. - bluez
  106. - network
  107. - network-bind
  108. - network-control
  109. - hardware-observe
  110. - raw-usb
  111. - serial-port
  112. - physical-memory-control
  113. - removable-media
  114. slots:
  115. - components
  116. open-localhost:
  117. command: bin/open-localhost
  118. plugs:
  119. - desktop
  120. check-config:
  121. plugs:
  122. - network
  123. environment:
  124. PIP_USER: 1
  125. command: bin/hass --script check_config --config $SNAP_DATA -i
  126. # package-repositories:
  127. # - type: apt
  128. # ppa: deadsnakes/ppa
  129. parts:
  130. snapcraft-preload:
  131. source: https://github.com/sergiusens/snapcraft-preload.git
  132. plugin: cmake
  133. cmake-parameters:
  134. - -DCMAKE_INSTALL_PREFIX=/
  135. build-packages:
  136. - on amd64:
  137. - gcc-multilib
  138. - g++-multilib
  139. python:
  140. plugin: autotools
  141. source: https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz
  142. autotools-configure-parameters:
  143. - --enable-optimizations
  144. build-packages:
  145. - build-essential
  146. - gdb
  147. - lcov
  148. - pkg-config
  149. - libbz2-dev
  150. - libffi-dev
  151. - libgdbm-dev
  152. - libgdbm-compat-dev
  153. - liblzma-dev
  154. - libncurses5-dev
  155. - libreadline6-dev
  156. - libsqlite3-dev
  157. - libssl-dev
  158. - lzma
  159. - lzma-dev
  160. - tk-dev
  161. - uuid-dev
  162. - zlib1g-dev
  163. override-stage: |
  164. snapcraftctl stage
  165. [ ! -d "${SNAPCRAFT_STAGE}/bin" ] && mkdir ${SNAPCRAFT_STAGE}/bin
  166. ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/bin/python3.9"
  167. ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/usr/bin/python3"
  168. stage-packages:
  169. - libfontconfig1
  170. - libfreetype6
  171. - libgdbm-compat4
  172. - libgdbm6
  173. - libpng16-16
  174. - libtcl8.6
  175. - libtk8.6
  176. - libx11-6
  177. - libxau6
  178. - libxcb1
  179. - libxdmcp6
  180. - libxext6
  181. - libxft2
  182. - libxrender1
  183. - libxss1
  184. - bluetooth
  185. - libbluetooth-dev
  186. homeassistant:
  187. after: [python]
  188. plugin: python-wot-plugin
  189. source: https://github.com/home-assistant/core.git
  190. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  191. build-environment:
  192. - SNAPCRAFT_PYTHON_INTERPRETER: python3.9
  193. python-packages:
  194. - setuptools #<58
  195. - wheel
  196. - Cython
  197. - pip
  198. - build
  199. build-packages:
  200. - autoconf
  201. - build-essential
  202. - cmake
  203. - cython3
  204. - ffmpeg
  205. - libavcodec-dev
  206. - libavdevice-dev
  207. - libavfilter-dev
  208. - libavformat-dev
  209. - libavresample-dev
  210. - libavutil-dev
  211. - libcrypt-dev
  212. - libffi-dev
  213. - libglib2.0-dev
  214. - libglu1-mesa-dev
  215. - libgpiod-dev
  216. - libjpeg-dev
  217. - libopenzwave1.5-dev
  218. - libpcap0.8-dev
  219. - libswresample-dev
  220. - libssl-dev
  221. - libswscale-dev
  222. - libudev-dev
  223. - libxml2-dev
  224. - libxslt1-dev
  225. - pkg-config
  226. #- python3-pip
  227. - python3.9-dev
  228. - zlib1g-dev
  229. - on arm64:
  230. - cargo
  231. - rustc
  232. - on armhf:
  233. - cargo
  234. - gfortran
  235. - rustc
  236. - on ppc64el:
  237. - cargo
  238. - rustc
  239. stage-packages:
  240. - freeglut3
  241. - ffmpeg
  242. - libglu1-mesa
  243. - libpcap0.8
  244. - libpcap0.8-dev
  245. - libpulse0
  246. - libturbojpeg
  247. - netbase
  248. - tcpdump
  249. - zlib1g
  250. stage:
  251. - -lib/python3.9/site-packages/homeassistant/components/updater
  252. - -lib/python3.9/site-packages/aiogithubapi*
  253. requirements:
  254. - requirements.txt
  255. - requirements_all.txt
  256. constraints:
  257. - homeassistant/package_constraints.txt
  258. override-stage: |
  259. snapcraftctl stage
  260. sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_STAGE/pyvenv.cfg
  261. updater:
  262. after: [homeassistant]
  263. plugin: dump
  264. source: ./src/components
  265. source-type: local
  266. organize:
  267. '*': lib/python3.9/site-packages/homeassistant/components/
  268. bins:
  269. plugin: dump
  270. source: ./src/bin
  271. source-type: local
  272. organize:
  273. open-localhost: bin/open-localhost
  274. hooks:
  275. plugin: dump
  276. source: ./src/hooks
  277. source-type: local
  278. stage-packages:
  279. - uuid
  280. organize:
  281. install: snap/hooks/install
  282. configure: snap/hooks/configure
  283. post-refresh: snap/hooks/post-refresh
  284. connect-plug-bin: snap/hooks/connect-plug-bin
  285. config:
  286. plugin: dump
  287. source: ./src/config
  288. source-type: local
  289. organize:
  290. plug-bin: bin/plug-bin