Permalink
Browse files

HASP 0.31

  • Loading branch information...
aderusha committed Dec 5, 2018
1 parent 637edc5 commit 9f70f0e159e7e331a42e59b2f7dc8e75d0c749c4
Showing with 828 additions and 845 deletions.
  1. BIN Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin
  2. +461 −326 Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino
  3. +0 −85 Home_Assistant/configuration.yaml
  4. +27 −4 Home_Assistant/deployhasp.sh
  5. +0 −10 Home_Assistant/examples/README.md
  6. +0 −15 Home_Assistant/examples/hasp_plate01_00_autofirmwareupdate.yaml
  7. +0 −26 Home_Assistant/examples/hasp_plate01_00_backlightbysun.yaml
  8. +0 −49 Home_Assistant/examples/hasp_plate01_00_kodisensor.yaml
  9. +0 −131 Home_Assistant/examples/hasp_plate01_p0_messagedisplay.yaml
  10. +53 −12 Home_Assistant/{packages → hasp-examples}/plate01/hasp_plate01_p8_media.yaml
  11. +31 −3 Home_Assistant/{packages → hasp-examples}/plate01/hasp_plate01_p9_3dprint.yaml
  12. BIN Home_Assistant/hasppackages.tar.gz
  13. +2 −33 Home_Assistant/packages/hasp_demo.yaml
  14. +22 −62 Home_Assistant/packages/plate01/hasp_plate01_00_components.yaml
  15. +56 −0 Home_Assistant/packages/plate01/hasp_plate01_00_motionsensor.yaml
  16. +46 −21 Home_Assistant/packages/plate01/hasp_plate01_p0_pages.yaml
  17. +16 −11 Home_Assistant/packages/plate01/hasp_plate01_p1_scenes.yaml
  18. +8 −3 Home_Assistant/packages/plate01/hasp_plate01_p2_clock.yaml
  19. +12 −7 Home_Assistant/packages/plate01/hasp_plate01_p2_weather.yaml
  20. +48 −23 Home_Assistant/packages/plate01/hasp_plate01_p3_toggles.yaml
  21. +8 −3 Home_Assistant/packages/plate01/hasp_plate01_p4_dimmers.yaml
  22. +37 −20 Home_Assistant/packages/plate01/hasp_plate01_p7_alarm.yaml
  23. +1 −1 update/version.json
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -60,12 +60,13 @@ if ! grep "^ packages: \!include_dir_named packages" configuration.yaml > /dev/
then
if grep "^ packages: " configuration.yaml > /dev/null
then
echo "==========================================================================="
echo "WARNING: Conflicting packages definition found in 'configuration.yaml'."
echo " Please add the following statement to your configuration:"
echo ""
echo "homeassistant:"
echo " packages: !include_dir_named packages"
echo ""
echo "==========================================================================="
else
sed -i 's/^homeassistant:.*/homeassistant:\n packages: !include_dir_named packages/' configuration.yaml
fi
@@ -85,14 +86,17 @@ then
echo " - input_text" >> configuration.yaml
fi
# Enable MQTT if not enabled
# Warn if MQTT is not enabled
if ! grep "^mqtt:" configuration.yaml > /dev/null
then
echo "==========================================================================="
echo "WARNING: Required MQTT broker configuration not setup in configuration.yaml"
echo "HASP will not function until this has been configured. The embedded option"
echo "HASP WILL NOT FUNCTION UNTIL THIS HAS BEEN CONFIGURED! The embedded option"
echo "offered my Home Assistant is buggy, so deploying Mosquitto is recommended."
echo ""
echo "Home Assistant MQTT configuration: https://www.home-assistant.io/docs/mqtt/broker/#run-your-own"
echo "Install Mosquitto: sudo apt-get install mosquitto mosquitto-clients"
echo "==========================================================================="
fi
# Hass has a bug where packaged automations don't work unless you have at least one
@@ -126,6 +130,8 @@ if [[ "$hasp_input_name" != "plate01" ]]
then
# rename text in contents of files
sed -i -- 's/plate01/'"$hasp_device"'/g' $hasp_temp_dir/packages/plate01/hasp_plate01_*.yaml
sed -i -- 's/plate01/'"$hasp_device"'/g' $hasp_temp_dir/hasp-examples/plate01/hasp_plate01_*.yaml
# rename files and folder - thanks to @cloggedDrain for this loop!
mkdir $hasp_temp_dir/packages/$hasp_device
for file in $hasp_temp_dir/packages/plate01/*
@@ -142,10 +148,27 @@ then
fi
done
rm -rf $hasp_temp_dir/packages/plate01
# do it again for the examples
mkdir $hasp_temp_dir/hasp-examples/$hasp_device
for file in $hasp_temp_dir/hasp-examples/plate01/*
do
new_file=`echo $file | sed s/plate01/$hasp_device/g`
if [ -f $file ]
then
mv $file $new_file
if [ $? -ne 0 ]
then
echo "ERROR: Could not copy $file to $new_file"
exit 1
fi
fi
done
rm -rf $hasp_temp_dir/hasp-examples/plate01
fi
# Copy everything over and burn the evidence
cp -rf $hasp_temp_dir/* .
rm -rf $hasp_temp_dir
echo "SUCCESS: Restart Home Assistant to apply changes and enable HASP device $hasp_device"
echo "==========================================================================="
echo "SUCCESS! Restart Home Assistant to enable HASP device $hasp_device"

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9f70f0e

Please sign in to comment.