1
0

snapcraft.yaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. name: home-assistant-snap
  2. title: Home assistant
  3. version: '2021.9.6'
  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. **Available slots**
  43. - *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.
  44. - *bin:* Missing binaries might be in the Home Assistant Toolbox, such as cURL etc. See https://snapcraft.io/home-assistant-toolbox
  45. - *configurator:* Edit your configuration files with HASS configurator. There is a ready package called Home Assistant Configurator here: 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. configurations:
  84. interface: content
  85. write:
  86. - $SNAP_DATA
  87. apps:
  88. home-assistant-snap:
  89. command: bin/hass --config $SNAP_DATA
  90. command-chain:
  91. - bin/plug-bin
  92. daemon: simple
  93. environment:
  94. PIP_USER: 1
  95. restart-condition: always
  96. plugs:
  97. - bluez
  98. - network
  99. - network-bind
  100. - network-control
  101. - raw-usb
  102. - serial-port
  103. - physical-memory-control
  104. - removable-media
  105. slots:
  106. - components
  107. open-localhost:
  108. command: bin/open-localhost
  109. plugs:
  110. - desktop
  111. check-config:
  112. plugs:
  113. - network
  114. environment:
  115. PIP_USER: 1
  116. command: bin/hass --script check_config --config $SNAP_DATA -i
  117. parts:
  118. homeassistant:
  119. plugin: python-wot-plugin
  120. source: https://github.com/home-assistant/core.git
  121. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  122. python-packages:
  123. - setuptools<58
  124. - wheel
  125. - Cython
  126. - pip
  127. build-packages:
  128. - python3
  129. - python3-dev
  130. - python3-pip
  131. # - python3-setuptools
  132. # - python3-wheel
  133. - pkg-config
  134. - autoconf
  135. - build-essential
  136. - cmake
  137. - cython3
  138. - ffmpeg
  139. - libavcodec-dev
  140. - libavdevice-dev
  141. - libavfilter-dev
  142. - libavformat-dev
  143. - libavresample-dev
  144. - libavutil-dev
  145. - libffi-dev
  146. - libglib2.0-dev
  147. - libglu1-mesa-dev
  148. - libgpiod-dev
  149. - libjpeg-dev
  150. - libopenzwave1.5-dev
  151. - libpcap0.8-dev
  152. - libswresample-dev
  153. - libssl-dev
  154. - libswscale-dev
  155. - libudev-dev
  156. - libxml2-dev
  157. - libxslt1-dev
  158. - zlib1g-dev
  159. stage-packages:
  160. - freeglut3
  161. - ffmpeg
  162. - libglu1-mesa
  163. - netbase
  164. - tcpdump
  165. - libpcap0.8
  166. - libpcap0.8-dev
  167. - zlib1g
  168. stage:
  169. - -lib/python3.8/site-packages/homeassistant/components/updater
  170. requirements:
  171. - requirements_all.txt
  172. constraints:
  173. - homeassistant/package_constraints.txt
  174. override-build: |
  175. python3 -m pip install -U setuptools
  176. snapcraftctl build
  177. sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
  178. # override-stage: |
  179. # snapcraftctl stage
  180. # ls -al ${SNAPCRAFT_STAGE}/
  181. # echo "WE're here now"
  182. # touch ${SNAPCRAFT_STAGE}/etc/ld.so.conf.d/ha-${SNAPCRAFT_ARCH_TRIPLET}.conf
  183. # # echo "/usr/lib/home-assistant" > prime/etc/ld.so.conf.d/libc.conf
  184. updater:
  185. after: [homeassistant]
  186. plugin: dump
  187. source: ./src/components
  188. source-type: local
  189. organize:
  190. '*': lib/python3.8/site-packages/homeassistant/components/
  191. bins:
  192. plugin: dump
  193. source: ./src/bin
  194. source-type: local
  195. organize:
  196. open-localhost: bin/open-localhost
  197. hooks:
  198. plugin: dump
  199. source: ./src/hooks
  200. source-type: local
  201. stage-packages:
  202. - uuid
  203. organize:
  204. install: snap/hooks/install
  205. configure: snap/hooks/configure
  206. post-refresh: snap/hooks/post-refresh
  207. connect-plug-bin: snap/hooks/connect-plug-bin
  208. config:
  209. plugin: dump
  210. source: ./src/config
  211. source-type: local
  212. organize:
  213. plug-bin: bin/plug-bin