From 0a199bdbfc1716da60e5189f996b457de1684a6e Mon Sep 17 00:00:00 2001 From: Fredrik Lindqvist Date: Sun, 8 Oct 2017 22:52:57 +0200 Subject: [PATCH] Razberry install script. (#57) * Add additional db install scripts * Add documentation for db install scripts * Add install script for Razberry * Add docs for install script for Razberry * Update README.md --- README.md | 24 +++++----- package/opt/hassbian/suites/install_hue.sh | 8 ++-- .../opt/hassbian/suites/install_razberry.sh | 45 +++++++++++++++++++ 3 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 package/opt/hassbian/suites/install_razberry.sh diff --git a/README.md b/README.md index bdbd2178..d47fac80 100644 --- a/README.md +++ b/README.md @@ -62,20 +62,6 @@ No database or database user is created during this setup and will need to be cr This script was originally contributed by [@Landrash](https://github.com/landrash). -#### Install MySQL *(install_mysql.sh)* -This script installs MySQL and it's dependencies for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant. -No database or database user is created during this setup and will need to be created manually. - -##### Example for creating database -```$ sudo mysql -u root -p``` -```$ CREATE DATABASE homeassistant;``` -```$ CREATE USER 'homeassistantuser' IDENTIFIED BY 'password';``` -```$ GRANT ALL PRIVILEGES ON homeassistant.* TO 'homeassistantuser';``` -```$ FLUSH PRIVILEGES;``` -```$ exit ``` - -This script was originally contributed by [@Landrash](https://github.com/landrash). - #### Install PostgreSQL *(install_postgresql.sh)* This script installs PostgreSQL and it's dependencies for use with the [recorder](https://home-assistant.io/components/recorder/) component in Home Assistant. No database or database user is created during this setup and will need to be created manually. @@ -156,6 +142,16 @@ panel_iframe: ``` This script was originally contributed by [@Ludeeus](https://github.com/Ludeeus). +### Install RaZberry *(install_razberry.sh)* +This script disables Bluetooth for the use of a RaZberry with Hassbian. +Code is adapted from the Razberry install script found at http://razberry.z-wave.me/install. +This will disable the use of Bluetooth and Bluetooth Low Energy devices. +``` +sudo hassbian-config install razberry +``` +This script was originally contributed by [@Landrash](https://github.com/Landrash). + + ## Upgrade script components ### Upgrade your Home Assistant installation *(uppgrade_home-assistant.sh)* diff --git a/package/opt/hassbian/suites/install_hue.sh b/package/opt/hassbian/suites/install_hue.sh index cb6f242e..38ff5933 100755 --- a/package/opt/hassbian/suites/install_hue.sh +++ b/package/opt/hassbian/suites/install_hue.sh @@ -1,16 +1,16 @@ #!/bin/bash function hue-show-short-info { - echo "Echo/Home/Mycroft Emulated Hue install script for Hassbian." + echo "Echo/Home/Mycroft Emulated Hue install script for Hassbian." } function hue-show-long-info { - echo "Configures the Python executable to allow usage of low numbered" - echo "ports for use with Amazon Echo, Google Home and Mycroft.ai." + echo "Configures the Python executable to allow usage of low numbered" + echo "ports for use with Amazon Echo, Google Home and Mycroft.ai." } function hue-show-copyright-info { - echo "Copyright(c) 2017 Fredrik Lindqvist " + echo "Copyright(c) 2017 Fredrik Lindqvist " } function hue-install-package { diff --git a/package/opt/hassbian/suites/install_razberry.sh b/package/opt/hassbian/suites/install_razberry.sh new file mode 100644 index 00000000..4115097f --- /dev/null +++ b/package/opt/hassbian/suites/install_razberry.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +function razberry-show-short-info { + echo "Disables Bluetooth for the use of a RaZberry with Hassbian." +} + +function razberry-show-long-info { + echo "Disables Bluetooth for the use of a RaZberry with Hassbian." + echo "This will disable the use of Bluetooth and BLE devices." + echo " " + echo "Original script from http://razberry.z-wave.me/install" +} + +function razberry-show-copyright-info { + echo "Original script from http://razberry.z-wave.me/install" +} + +function razberry-install-package { +razberry-show-short-info +razberry-show-copyright-info + +echo "Checking for version of Raspberry Pi" +RPI_BOARD_REVISION=`grep Revision /proc/cpuinfo | cut -d: -f2 | tr -d " "` +if [[ $RPI_BOARD_REVISION == "a02082" || $RPI_BOARD_REVISION == "a22082" ]] +then + echo "Raspberry Pi 3 Detected. Disabling Bluetooth" + systemctl disable hciuart + if [[ ! `grep "dtoverlay=pi3-miniuart-bt" /boot/config.txt` ]] + then + echo "Adding 'dtoverlay=pi3-miniuart-bt' to /boot/config.txt" + echo "dtoverlay=pi3-miniuart-bt" >> /boot/config.txt + fi +fi + +echo +echo "Installation done." +echo +echo "To continue have a look at https://home-assistant.io/components/emulated_hue/" +echo +echo "If you have issues with this script, please say something in the #Hassbian channel on Discord." +echo +return 0 +} + +[[ $_ == $0 ]] && echo "hassbian-config helper script; do not run directly, use hassbian-config install instead"