1
0

snapcraft.yaml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. name: home-assistant-snap
  2. title: Home assistant
  3. version: '2021.12.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 change localhost to any other IP address where the snap packages is installed). You will get a launcher available in your application menu on desktops.
  15. **Important information about updates**
  16. Since each major versions of Home Assistant might bring breaking changes, 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` from `false` 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 from the community.
  28. **Necessary plugs**
  29. Can't connect to your USB (e.g Zigbee, Z-wave, removable drive)?
  30. See `snap connections home-assistant-snap` for necessary plugs (such as access to USB, removable media etc) and connect them with
  31. `$ snap connect home-assistant-snap:<plug>`
  32. where `<plug>` can be in example `raw-usb`.
  33. **Required plugs**
  34. - *network:* allows Home Assistant access to the network.
  35. - *network-bind:* allows operating as a network service, to run the Home Assistant server.
  36. - *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`.
  37. **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/
  38. **Optional plugs**
  39. - *raw-usb:* allows access to all connected USB devices via a raw interface.
  40. - *removable-media*: allows read/write access to mounted removable storage in /media, /run/media and /mnt.
  41. - *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`.
  42. - *hardware-observe*: required to use the `usb` discovery component
  43. **Available slots**
  44. - *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.
  45. - *bin:* Missing binaries might be in the Home Assistant Toolbox, such as cURL etc. See https://snapcraft.io/home-assistant-toolbox
  46. - *configurations:* Edit your configuration files with `code-server` (VS Code) or HASS configurator:
  47. - https://snapcraft.io/code-server
  48. - https://snapcraft.io/home-assistant-configurator.
  49. # source-code: "https://github.com/home-assistant-snap/home-assistant-snap"
  50. # website: "https://github.com/home-assistant-snap/home-assistant-snap"
  51. # issues: "https://github.com/home-assistant-snap/home-assistant-snap/issues"
  52. # donation: "https://www.paypal.com/donate/?hosted_button_id=69NA8SXXFBDBN"
  53. license: Apache-2.0
  54. base: core20
  55. grade: stable
  56. confinement: strict
  57. architectures:
  58. - build-on: amd64
  59. - build-on: arm64
  60. - build-on: armhf
  61. - build-on: ppc64el
  62. layout:
  63. /usr/local/lib:
  64. bind: $SNAP/usr/lib/${SNAPCRAFT_ARCH_TRIPLET}
  65. /etc/pip.conf:
  66. bind-file: $SNAP_COMMON/pip.conf
  67. /etc/openzwave:
  68. bind: $SNAP/openzwave
  69. /etc/ethertypes:
  70. bind-file: $SNAP/etc/ethertypes
  71. /etc/protocols:
  72. bind-file: $SNAP/etc/protocols
  73. /etc/services:
  74. bind-file: $SNAP/etc/services
  75. plugs:
  76. bin:
  77. interface: content
  78. content: executables
  79. target: $SNAP/shared-bin
  80. slots:
  81. components:
  82. interface: content
  83. content: components
  84. write:
  85. - $SNAP_DATA/custom_components
  86. configurations:
  87. interface: content
  88. write:
  89. - $SNAP_DATA
  90. vscs-content:
  91. interface: content
  92. write:
  93. - $SNAP_DATA
  94. apps:
  95. home-assistant-snap:
  96. command: bin/hass --config $SNAP_DATA
  97. command-chain:
  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. python:
  131. plugin: autotools
  132. source: https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tgz
  133. autotools-configure-parameters:
  134. - --enable-optimizations
  135. build-packages:
  136. - build-essential
  137. - gdb
  138. - lcov
  139. - pkg-config
  140. - libbz2-dev
  141. - libffi-dev
  142. - libgdbm-dev
  143. - libgdbm-compat-dev
  144. - liblzma-dev
  145. - libncurses5-dev
  146. - libreadline6-dev
  147. - libsqlite3-dev
  148. - libssl-dev
  149. - lzma
  150. - lzma-dev
  151. - tk-dev
  152. - uuid-dev
  153. - zlib1g-dev
  154. override-stage: |
  155. snapcraftctl stage
  156. [ ! -d "${SNAPCRAFT_STAGE}/bin" ] && mkdir ${SNAPCRAFT_STAGE}/bin
  157. ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/bin/python3.9"
  158. ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/usr/bin/python3"
  159. stage-packages:
  160. - libfontconfig1
  161. - libfreetype6
  162. - libgdbm-compat4
  163. - libgdbm6
  164. - libpng16-16
  165. - libtcl8.6
  166. - libtk8.6
  167. - libx11-6
  168. - libxau6
  169. - libxcb1
  170. - libxdmcp6
  171. - libxext6
  172. - libxft2
  173. - libxrender1
  174. - libxss1
  175. homeassistant:
  176. after: [python]
  177. plugin: python #-wot-plugin
  178. source: https://github.com/home-assistant/core.git
  179. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  180. build-environment:
  181. - SNAPCRAFT_PYTHON_INTERPRETER: python3.9
  182. python-packages:
  183. - setuptools<58
  184. - wheel
  185. - Cython
  186. - pip
  187. build-packages:
  188. - autoconf
  189. - build-essential
  190. - cmake
  191. - cython3
  192. - ffmpeg
  193. - libavcodec-dev
  194. - libavdevice-dev
  195. - libavfilter-dev
  196. - libavformat-dev
  197. - libavresample-dev
  198. - libavutil-dev
  199. - libcrypt-dev
  200. - libffi-dev
  201. - libglib2.0-dev
  202. - libglu1-mesa-dev
  203. - libgpiod-dev
  204. - libjpeg-dev
  205. - libopenzwave1.5-dev
  206. - libpcap0.8-dev
  207. - libswresample-dev
  208. - libssl-dev
  209. - libswscale-dev
  210. - libudev-dev
  211. - libxml2-dev
  212. - libxslt1-dev
  213. - pkg-config
  214. - python3-pip
  215. - python3.9-dev
  216. - zlib1g-dev
  217. - on armhf:
  218. - cargo
  219. # - dpkg-dev
  220. # - gcc
  221. # - libfreetype-dev
  222. # - make
  223. - rustc
  224. - on ppc64el:
  225. - cargo
  226. - rustc
  227. stage-packages:
  228. - freeglut3
  229. - ffmpeg
  230. - libglu1-mesa
  231. - libpcap0.8
  232. - libpcap0.8-dev
  233. - libpulse0
  234. - libturbojpeg
  235. - netbase
  236. - tcpdump
  237. - zlib1g
  238. stage:
  239. - -lib/python3.9/site-packages/homeassistant/components/updater
  240. - -lib/python3.9/site-packages/aiogithubapi*
  241. requirements:
  242. - requirements_all.txt
  243. constraints:
  244. - homeassistant/package_constraints.txt
  245. override-stage: |
  246. snapcraftctl stage
  247. sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_STAGE/pyvenv.cfg
  248. updater:
  249. after: [homeassistant]
  250. plugin: dump
  251. source: ./src/components
  252. source-type: local
  253. organize:
  254. '*': lib/python3.9/site-packages/homeassistant/components/
  255. bins:
  256. plugin: dump
  257. source: ./src/bin
  258. source-type: local
  259. organize:
  260. open-localhost: bin/open-localhost
  261. hooks:
  262. plugin: dump
  263. source: ./src/hooks
  264. source-type: local
  265. stage-packages:
  266. - uuid
  267. organize:
  268. install: snap/hooks/install
  269. configure: snap/hooks/configure
  270. post-refresh: snap/hooks/post-refresh
  271. connect-plug-bin: snap/hooks/connect-plug-bin
  272. config:
  273. plugin: dump
  274. source: ./src/config
  275. source-type: local
  276. organize:
  277. plug-bin: bin/plug-bin