From 4de578a87a22464bb871e49e7012c5487fddd824 Mon Sep 17 00:00:00 2001 From: TheYOSH Date: Sun, 7 Jul 2019 19:05:51 +0200 Subject: [PATCH] Renamed example script --- contrib/switch_toggle.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100755 contrib/switch_toggle.py diff --git a/contrib/switch_toggle.py b/contrib/switch_toggle.py deleted file mode 100755 index a18ae2bf3..000000000 --- a/contrib/switch_toggle.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -import sys - -# This is just an example script to test the functionality for TerrariumPI. It is also a reference for implementing your own scripts - -if len(sys.argv) == 1: - raise SyntaxError('No arguments specified') - -try: - value = int(sys.argv[1]) -except Exception as ex: - raise ValueError('Invalid input value. Should be a number between 0 and 100 including') - -if not (0 <= value <= 100): - raise ValueError('Invalid input value. Should be a number between 0 and 100 including') - -if value == 0: - print('Toggle power switch to state OFF') - # Call your code here.... -else: - print('Toggle power switch to state ON or dimming value: {}'.format(value)) - # Call your code here....