This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on init | |
do | |
setvar $leaf=1 %leaf state | |
setvar $tesla=1 | |
setvar $pn=0 %pilot new | |
setvar $teslamp="" | |
subscribe local "ev/+/state" | |
subscribe local "ev/+" | |
on topic local "ev/+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -n "USERNAME: "; read uname | |
echo -n "PASSWORD: "; stty -echo; read passwd; stty echo; echo | |
OAUTH=$(curl -s -i -X POST -H 'Content-Type: application/json' -d "{\"grant_type\": \"password\", \"client_id\": \"81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384\", \"client_secret\": \"c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3\", \"email\": \"$uname\",\"password\": \"$passwd\"}" "https://owner-api.teslamotors.com/oauth/token") | |
if [[ "$OAUTH" =~ \"access_token\":\ ?\"([0-9a-f]+)\" ]]; then | |
access_token=${BASH_REMATCH[1]} | |
else | |
echo "Error, no access token received:" | |
echo $OAUTH | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiegandNG.h> //https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino | |
//needs https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino/pull/6 | |
WiegandNG wg; | |
void PrintAR6182(WiegandNG &tempwg) { | |
volatile unsigned char *rawData=tempwg.getRawData(); | |
uint8_t rawSize = tempwg.getBufferSize(); | |
uint8_t countedBits = tempwg.getBitCounted(); | |
uint8_t pinDigits = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
use Hashids\Hashids; | |
$hashids = new Hashids('somerandomtext', 6, 'abcdefghijklmnopqrstuvwxyz'); | |
$db = new SQLite3('door.db'); | |
$db->busyTimeout(5000); | |
$db->exec('CREATE TABLE IF NOT EXISTS tokens (id INTEGER PRIMARY KEY AUTOINCREMENT, refrence TEXT(64), count INTEGER, valid_from DATETIME, valid_to DATETIME)'); |