snapcraft.yaml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. name: home-assistant-snap
  2. title: Home assistant
  3. version: '2022.10.5'
  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. layout:
  59. /usr/local/lib:
  60. bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}
  61. /etc/pip.conf:
  62. bind-file: $SNAP_COMMON/pip.conf
  63. /etc/openzwave:
  64. bind: $SNAP/openzwave
  65. /etc/ethertypes:
  66. bind-file: $SNAP/etc/ethertypes
  67. /etc/protocols:
  68. bind-file: $SNAP/etc/protocols
  69. /etc/services:
  70. bind-file: $SNAP/etc/services
  71. plugs:
  72. bin:
  73. interface: content
  74. content: executables
  75. target: $SNAP/shared-bin
  76. slots:
  77. components:
  78. interface: content
  79. content: components
  80. write:
  81. - $SNAP_DATA/custom_components
  82. configurations:
  83. interface: content
  84. content: vscs-content
  85. write:
  86. - $SNAP_DATA
  87. vscs-content:
  88. interface: content
  89. content: vscs-content
  90. write:
  91. - $SNAP_DATA
  92. apps:
  93. home-assistant-snap:
  94. command: bin/hass --config $SNAP_DATA
  95. command-chain:
  96. - bin/snapcraft-preload
  97. - bin/plug-bin
  98. daemon: simple
  99. environment:
  100. PIP_USER: 1
  101. restart-condition: always
  102. plugs:
  103. - bluez
  104. - network
  105. - network-bind
  106. - network-control
  107. - hardware-observe
  108. - raw-usb
  109. - serial-port
  110. - physical-memory-control
  111. - removable-media
  112. slots:
  113. - components
  114. open-localhost:
  115. command: bin/open-localhost
  116. plugs:
  117. - desktop
  118. check-config:
  119. plugs:
  120. - network
  121. environment:
  122. PIP_USER: 1
  123. command: bin/hass --script check_config --config $SNAP_DATA -i
  124. package-repositories:
  125. - type: apt
  126. ppa: deadsnakes/ppa
  127. parts:
  128. snapcraft-preload:
  129. source: https://github.com/sergiusens/snapcraft-preload.git
  130. plugin: cmake
  131. cmake-parameters:
  132. - -DCMAKE_INSTALL_PREFIX=/
  133. build-packages:
  134. - on amd64:
  135. - gcc-multilib
  136. - g++-multilib
  137. #- lib32stdc++6
  138. homeassistant:
  139. plugin: python-wot-plugin
  140. source: https://github.com/home-assistant/core.git
  141. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  142. build-environment:
  143. - SNAPCRAFT_PYTHON_INTERPRETER: python3.10
  144. python-packages:
  145. - setuptools #<58
  146. - wheel
  147. - Cython
  148. - pip
  149. - build
  150. build-packages:
  151. - autoconf
  152. - build-essential
  153. - cmake
  154. - cython3
  155. - ffmpeg
  156. - libavcodec-dev
  157. - libavdevice-dev
  158. - libavfilter-dev
  159. - libavformat-dev
  160. - libavresample-dev # Needed?
  161. - libavutil-dev
  162. - libcrypt-dev
  163. - libffi-dev
  164. - libglib2.0-dev
  165. - libglu1-mesa-dev
  166. - libgpiod-dev
  167. - libjpeg-dev
  168. - libpcap0.8-dev
  169. - libswresample-dev
  170. - libssl-dev
  171. - libswscale-dev
  172. - libudev-dev
  173. - libxml2-dev
  174. - libxslt1-dev
  175. - pkg-config
  176. - python3.10-dev
  177. - zlib1g-dev
  178. # - on arm64:
  179. # - cargo
  180. # - rustc
  181. - on armhf:
  182. - gfortran
  183. - libatlas-base-dev
  184. - rustc
  185. # - cargo
  186. # - rustc
  187. # - on ppc64el:
  188. # - cargo
  189. # - rustc
  190. stage-packages:
  191. - freeglut3
  192. - ffmpeg
  193. - libglu1-mesa
  194. - libpcap0.8
  195. - libpcap0.8-dev
  196. - libpulse0
  197. - libturbojpeg
  198. - netbase
  199. - tcpdump
  200. - zlib1g
  201. - python3.10-venv
  202. stage:
  203. - -lib/python3.10/site-packages/homeassistant/components/updater
  204. - -lib/python3.10/site-packages/aiogithubapi*
  205. requirements:
  206. - requirements.txt
  207. - requirements_all.txt
  208. constraints:
  209. - homeassistant/package_constraints.txt
  210. override-build: |
  211. snapcraftctl build
  212. override-stage: |
  213. snapcraftctl stage
  214. find $SNAPCRAFT_STAGE/bin -type f -executable -exec sed -i 's/!\/usr\/bin\/env python3.10/!\/usr\/bin\/env python3/' {} \;
  215. sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_STAGE/pyvenv.cfg
  216. updater:
  217. after: [homeassistant]
  218. plugin: dump
  219. source: ./src/components
  220. source-type: local
  221. organize:
  222. '*': lib/python3.10/site-packages/homeassistant/components/
  223. bins:
  224. plugin: dump
  225. source: ./src/bin
  226. source-type: local
  227. organize:
  228. open-localhost: bin/open-localhost
  229. hooks:
  230. plugin: dump
  231. source: ./src/hooks
  232. source-type: local
  233. stage-packages:
  234. - uuid
  235. organize:
  236. install: snap/hooks/install
  237. configure: snap/hooks/configure
  238. post-refresh: snap/hooks/post-refresh
  239. connect-plug-bin: snap/hooks/connect-plug-bin
  240. config:
  241. plugin: dump
  242. source: ./src/config
  243. source-type: local
  244. organize:
  245. plug-bin: bin/plug-bin