Web interface using Angular 2 and Angular CLI for displaying informations
git clone https://github.com/T3kstiil3/Magic-Mirror.git
cd Magic-Mirror
npm install
- Rename ApiService file (remove exemple.)
- Replace api key and url
ng serve
ng build
ng generate component test
Read Angular CLI documentation :) Angular CLI
When building you can modify base tag (<base href="/">
) in your index.html with --base-href your-url
option.
# Sets base tag href to /myUrl/ in your index.html
ng build --base-href /myUrl/
ng build --bh /myUrl/
ng test
Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false
.
ng e2e
Before running the tests make sure you are serving the app via ng serve
.
End-to-end tests are run via Protractor.
import RPi.GPIO as GPIO #import
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor
screen = False #Screen ON on start by default
timeON = 300 #Screen On 5 minutes
time.sleep(timeON)
def toggleScreen():
GPIO.setup(7, GPIO.IN)
time.sleep(0.5)
GPIO.setup(7, GPIO.OUT)
return;
while True:
i=GPIO.input(11)
if i==0: #When output from motion sensor is LOW
print "No intruders",i
time.sleep(1)
if screen == True:
toggleScreen()
screen = False
elif i==1: #When output from motion sensor is HIGH
print "Intruder detected",i
toggleScreen()
screen = True
time.sleep(timeON)
- Date time
- Weather
- Xee Car
- Bike Vlille
- Home
- ...
- Monitor
- APP
- Xee Services Ng2
- VLille Services Ng2
- Weather night icon
- Domoticz Services Ng2
- News widgets
- Hardware Motion et Relay sensor