Remove bluetooth add-on & fix lint (#400)

This commit is contained in:
Pascal Vizeli
2018-09-06 00:05:50 +02:00
committed by GitHub
parent dca2ac51ff
commit 8551273568
13 changed files with 14 additions and 94 deletions

View File

@@ -1,21 +0,0 @@
# Changelog
## 2.3
- Enable PSCAN
## 2.2
- Fix device-tree path for Supervisor 113
## 2.1
- Support new way to read `serial-number` from device-tree
## 2.0
- Update Firmware blobs
## 1.1
- Some cleanups
- Use new baudrate
- Set bluetooth mac
## 1.0
- Update base image

View File

@@ -1,17 +0,0 @@
ARG BUILD_FROM
FROM $BUILD_FROM
# Add env
ENV LANG C.UTF-8
# Setup base
RUN apk add --no-cache bluez-deprecated
# Copy firmware
COPY firmware/* /lib/firmware/brcm/
# Copy data
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]

View File

@@ -1,16 +0,0 @@
{
"name": "Bluetooth BCM43xx (ResinOS)",
"version": "2.3",
"slug": "bluetooth_bcm43xx",
"description": "Activate Bluetooth for Broadcom 43xx chips for ResinOS",
"url": "https://home-assistant.io/addons/bluetooth_bcm43xx/",
"startup": "initialize",
"boot": "auto",
"host_network": true,
"devicetree": true,
"privileged": ["NET_ADMIN"],
"devices": ["/dev/ttyAMA0:/dev/ttyAMA0:rwm"],
"options": {},
"schema": {},
"image": "homeassistant/{arch}-addon-bluetooth_bcm43xx"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,26 +0,0 @@
#!/bin/bash
set -e
# Read serial number
if [ -e /device-tree/serial-number ]; then
SERIAL="$(cut -c9- /device-tree/serial-number)"
else
SERIAL="$(grep Serial /proc/cpuinfo | cut -c19-)"
fi
# Generate MAC
B1="$(echo "$SERIAL" | cut -c3-4)"
B2="$(echo "$SERIAL" | cut -c5-6)"
B3="$(echo "$SERIAL" | cut -c7-8)"
BDADDR="$(printf b8:27:eb:%02x:%02x:%02x $((0x$B1 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B3 ^ 0xaa)))"
hciattach /dev/ttyAMA0 bcm43xx 921600 - "$BDADDR"
sleep 1
hciconfig hci0 up
hciconfig hci0 piscan
while pgrep hciattach > /dev/null
do
sleep 600
done

View File

@@ -28,17 +28,17 @@ if [ "$SSL" == "true" ]; then
fi
LOGLEVEL=$(jq --raw-output '.loglevel // empty' $CONFIG_PATH)
if [ ! -z "$LOGLEVEL" ]; then
if [ -n "$LOGLEVEL" ]; then
export HC_LOGLEVEL=$LOGLEVEL
fi
SESAME=$(jq --raw-output '.sesame // empty' $CONFIG_PATH)
if [ ! -z "$SESAME" ]; then
if [ -n "$SESAME" ]; then
export HC_SESAME=$SESAME
fi
SESAME_TOTP_SECRET=$(jq --raw-output '.sesame_totp_secret // empty' $CONFIG_PATH)
if [ ! -z "$SESAME_TOTP_SECRET" ]; then
if [ -n "$SESAME_TOTP_SECRET" ]; then
export HC_SESAME_TOTP_SECRET=$SESAME_TOTP_SECRET
fi

View File

@@ -11,7 +11,7 @@ echo "[Info] Remove old deps"
rm -rf /config/deps/*
# Need custom apk for build?
if [ ! -z "$APK" ]; then
if [ -n "$APK" ]; then
echo "[Info] Install apks for build"
if ! ERROR="$(apk add --no-cache "${APK[@]}")"; then
echo "[Error] Can't install packages!"

View File

@@ -75,7 +75,7 @@ fi
}
function setup-user-password {
if [ ! -z "$DEPLOYMENT_USER" ]; then
if [ -n "$DEPLOYMENT_USER" ]; then
cd /config || return
echo "[Info] setting up credential.helper for user: ${DEPLOYMENT_USER}"
git config --system credential.helper 'store --file=/tmp/git-credentials'

View File

@@ -43,7 +43,7 @@ if [ "$MQTT_BRIDGE" == "true" ]; then
echo "address $HOST:$PORT"
} >> /etc/mosquitto.conf
if [ ! -z "$USER" ]; then
if [ -n "$USER" ]; then
{
echo "username $USER"
echo "password $PASSWORD"

View File

@@ -11,7 +11,7 @@ PASSWORD=$(jq --raw-output ".password" $CONFIG_PATH)
sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config
sed -i s/#LogLevel.*/LogLevel\ DEBUG/ /etc/ssh/sshd_config
if [ ! -z "$AUTHORIZED_KEYS" ]; then
if [ -n "$AUTHORIZED_KEYS" ]; then
echo "[INFO] Setup authorized_keys"
mkdir -p ~/.ssh
@@ -21,7 +21,7 @@ if [ ! -z "$AUTHORIZED_KEYS" ]; then
chmod 600 ~/.ssh/authorized_keys
sed -i s/#PasswordAuthentication.*/PasswordAuthentication\ no/ /etc/ssh/sshd_config
elif [ ! -z "$PASSWORD" ]; then
elif [ -n "$PASSWORD" ]; then
echo "[INFO] Setup password login"
echo "root:$PASSWORD" | chpasswd 2&> /dev/null

View File

@@ -29,23 +29,23 @@ for (( i=0; i < "$DEVICES"; i++ )); do
echo " name = \"$DEV_NAME\""
echo " protocol = \"$DEV_PROTO\""
if [ ! -z "$DEV_MODEL" ]; then
if [ -n "$DEV_MODEL" ]; then
echo " model = \"$DEV_MODEL\""
fi
if [ ! -z "$ATTR_HOUSE" ] || [ ! -z "$ATTR_CODE" ] || [ ! -z "$ATTR_UNIT" ] || [ ! -z "$ATTR_FADE" ]; then
if [ -n "$ATTR_HOUSE" ] || [ -n "$ATTR_CODE" ] || [ -n "$ATTR_UNIT" ] || [ -n "$ATTR_FADE" ]; then
echo " parameters {"
if [ ! -z "$ATTR_HOUSE" ]; then
if [ -n "$ATTR_HOUSE" ]; then
echo " house = \"$ATTR_HOUSE\""
fi
if [ ! -z "$ATTR_CODE" ]; then
if [ -n "$ATTR_CODE" ]; then
echo " code = \"$ATTR_CODE\""
fi
if [ ! -z "$ATTR_UNIT" ]; then
if [ -n "$ATTR_UNIT" ]; then
echo " unit = \"$ATTR_UNIT\""
fi
if [ ! -z "$ATTR_FADE" ]; then
if [ -n "$ATTR_FADE" ]; then
echo " fade = \"$ATTR_FADE\""
fi