snapcraft.yaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. name: zwavejs2mqtt
  2. base: core20
  3. version: 'v5.7.2'
  4. summary: Fully configurable Zwave to MQTT Gateway and Control Panel.
  5. description: |
  6. - Configurable Zwave to Mqtt Gateway
  7. - Home Assistant integration (beta)
  8. - Zwave Control Panel:
  9. - Nodes management: check all nodes discovered in the z-wave network, send/receive nodes values updates directly from the UI and send action to the nodes and controller for diagnostics and network heal Custom Node naming and Location: Starting from v1.3.0 nodes name and location are stored in a JSON file named nodes.json. This because not all nodes have native support for naming and location features (#45). This change is back compatible with older versions of this package: on startup it will get all nodes names and location from the zwcfg_homeHEX.xml file (if present) and create the new nodes.json file based on that. This file can be imported/exported from the UI control panel with the import/export buttons placed on the top of nodes table, on the right of controller actions select.
  10. - Firmware updates: You are able to send firmware updates to your devices using the UI, just select the controller action Begin Firmware Update
  11. - Groups associations: create associations between nodes (also supports multi-instance associations, need to use last version of zwave-js)
  12. - Custom scenes management
  13. - Log debug in UI
  14. - Mesh graph showing devices neighbors
  15. grade: stable # must be 'stable' to release into candidate/stable channels
  16. confinement: strict # use 'strict' once you have the right plugs and slots
  17. assumes:
  18. - command-chain
  19. architectures:
  20. - build-on: amd64
  21. - build-on: arm64
  22. - build-on: armhf
  23. apps:
  24. zwavejs2mqtt:
  25. daemon: simple
  26. restart-condition: always
  27. environment:
  28. STORE_DIR: $SNAP_DATA
  29. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  30. DAEMONIZED: 1
  31. command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt --global-folder $SNAP/lib/node_modules/npm/node_modules start
  32. command-chain:
  33. - helper/env-wrapper
  34. plugs:
  35. - network
  36. - network-bind
  37. - raw-usb
  38. - serial-port
  39. - hardware-observe
  40. exec:
  41. environment:
  42. STORE_DIR: $SNAP_DATA
  43. ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
  44. command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt start
  45. command-chain:
  46. - helper/env-wrapper
  47. plugs:
  48. - network
  49. - network-bind
  50. - raw-usb
  51. - serial-port
  52. - hardware-observe
  53. help:
  54. command: helper/env-wrapper --help
  55. enable:
  56. command: bin/daemonize
  57. disable:
  58. command: bin/de-daemonize
  59. restart:
  60. command: bin/restart
  61. layout:
  62. /usr/local/share/.cache/yarn:
  63. bind: $SNAP/.cache/yarn
  64. /usr/local/share/.yarn:
  65. symlink: $SNAP/lib/node_modules
  66. # $SNAP/lib/node_modules/zwavejs2mqtt/package.json.lock:
  67. # bind-file: $SNAP_DATA/.ext-config.lock
  68. # Not needed anymore as of ZWAVEJS_EXTERNAL_CONFIG ?
  69. # $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config:
  70. # bind: $SNAP/lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config
  71. parts:
  72. zwavejs2mqtt:
  73. after: [nodejs]
  74. plugin: dump
  75. source: https://github.com/zwave-js/zwavejs2mqtt.git
  76. #source-branch: "fix#1762"
  77. #source-tag: $SNAPCRAFT_PROJECT_VERSION
  78. build-packages:
  79. - gcc
  80. - build-essential
  81. override-build: |
  82. set -x
  83. #sed -i 's/"zwave-js".*$/"zwave-js"\: "8.3.2-0-pr-3262-f5cdbca"/g' ${SNAPCRAFT_PART_BUILD}/package.json
  84. if [ -n "${http_proxy-}" ]; then
  85. export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
  86. export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
  87. fi
  88. yarn install
  89. yarn run build \
  90. && mkdir -p $SNAPCRAFT_PART_INSTALL/lib/node_modules \
  91. && cp --archive --link --no-dereference $SNAPCRAFT_PART_BUILD \
  92. $SNAPCRAFT_PART_INSTALL/lib/node_modules/zwavejs2mqtt \
  93. organize:
  94. # Not needed anymore as of ZWAVEJS_EXTERNAL_CONFIG?
  95. # lib/node_modules/zwavejs2mqtt/node_modules/@zwave-js/config: snap/zwave-js/config
  96. lib/node_modules/zwavejs2mqtt/dist: lib/node_modules/zwavejs2mqtt/server/dist
  97. lib/node_modules/zwavejs2mqtt/views: lib/node_modules/zwavejs2mqtt/server/views
  98. filesets:
  99. zwavejs2mqtt-include:
  100. - lib/node_modules/zwavejs2mqtt/.git
  101. - lib/node_modules/zwavejs2mqtt/LICENSE
  102. - lib/node_modules/zwavejs2mqtt/*.md
  103. - lib/node_modules/zwavejs2mqtt/node_modules
  104. - lib/node_modules/zwavejs2mqtt/server
  105. - lib/node_modules/zwavejs2mqtt/package.json
  106. - lib/node_modules/zwavejs2mqtt/yarn.lock
  107. stage:
  108. - $zwavejs2mqtt-include
  109. dependencies:
  110. plugin: nil
  111. stage-snaps:
  112. - jq
  113. - yq
  114. stage-packages:
  115. - git
  116. - udev
  117. - rsync
  118. nodejs:
  119. plugin: dump
  120. source:
  121. - on amd64: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.gz
  122. - on arm64: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-arm64.tar.gz
  123. - on armhf: https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-armv7l.tar.gz
  124. stage-packages:
  125. - on armhf:
  126. - libatomic1
  127. override-stage: |
  128. npm install --global yarn
  129. snapcraftctl stage
  130. organize:
  131. '*.md' : nodejs/
  132. LICENSE : nodejs/
  133. prime:
  134. - -include
  135. - -share
  136. local:
  137. plugin: dump
  138. source: src/
  139. stage-packages:
  140. - uuid
  141. organize:
  142. hooks: snap/hooks