Skip to content

Instantly share code, notes, and snippets.

View ben-willmore's full-sized avatar

Ben Willmore ben-willmore

View GitHub Profile
/***************************************************
Velux controller for ESP8266.
Requires an original Velux remote control switch and an MQTT server.
See link below for how to connect the ESP8266 to the switch:
https://www.reddit.com/r/homeassistant/comments/pzhkia/hack_velux_kli3xx_to_use_blinds_without_gateway/
Derived from https://github.com/adafruit/Adafruit_MQTT_Library
Original code written by Tony DiCola for Adafruit Industries.
Adapted for Velux blinds by Ben Willmore.
@ben-willmore
ben-willmore / gist:0662dbcaaf426b404d7e47797ec6f69c
Created March 5, 2019 21:13
successful trace from honda jazz
< 11 00 55 0E 00 13 00 00 04 11 00 00 00 02 00 00 02 00 C6 00 00 00 00 00 00 00
> 02 00 55 04 00 02 00 13 E7 00
> 02 00 55 04 00 14 00 01 E7 00
< 0E 00 55 03 00 0F 00 EE 00 00
> 02 00 55 05 00 10 00 01 01 E9
< 0E 00 55 03 00 0F 04 EA 00 00
> 02 00 55 05 00 10 04 01 01 E5
< 0E 00 55 03 00 0F 0A E4 00 00
> 02 00 55 05 00 10 0A 01 03 DD
< 12 02 55 86 00 15 02 00 00 07 30 82 03 AD 06 09 2A 86 48 86 F7 0D 01 07 02 A0 82 03 9E 30 82 03 9A 02 01 01 31 00 30 0B 06 09 2A 86 48 86 F7 0D 01 07
INFO[0000.020398] device opened path=/dev/iap0
WARN[0000.026796] writing trace path=ipod.trace
INFO[0000.589625] << FRAME len=24
([]uint8) (len=24 cap=64) {
00000000 55 0e 00 13 00 00 04 11 00 00 00 02 00 00 02 00 |U...............|
00000010 c6 00 00 00 00 00 00 00 |........|
}
INFO[0000.605671] << PACKET len=14
([]uint8) (len=14 cap=15) {
00000000 00 13 00 00 04 11 00 00 00 02 00 00 02 00 |..............|
INFO[0000.020600] device opened path=/dev/iap0
WARN[0000.026805] writing trace path=ipod.trace
INFO[0000.590190] << FRAME len=24
([]uint8) (len=24 cap=64) {
00000000 55 0e 00 13 00 00 04 11 00 00 00 02 00 00 02 00 |U...............|
00000010 c6 00 00 00 00 00 00 00 |........|
}
INFO[0000.606521] << PACKET len=14
([]uint8) (len=14 cap=15) {
00000000 00 13 00 00 04 11 00 00 00 02 00 00 02 00 |..............|
@ben-willmore
ben-willmore / onedir.patch
Created May 14, 2017 20:23
pyupdater onedir patch
diff --git a/pyupdater/client/updates.py b/pyupdater/client/updates.py
index f610963..547e60e 100644
--- a/pyupdater/client/updates.py
+++ b/pyupdater/client/updates.py
@@ -624,16 +624,29 @@ class AppUpdate(LibUpdate):
temp_dir = get_mac_dot_app_dir(self._current_app_dir)
self._current_app_dir = temp_dir
- app_update = os.path.join(self.update_folder, self.name)
+ #app_update = os.path.join(self.update_folder, self.name)
@ben-willmore
ben-willmore / gist:5822286
Last active December 18, 2015 17:59
multiple line multiple caret
assert(all([res(:,1).nr25]==[res(:,2).nr25]));
assert(all([res(:,1).nr25]==[res(:,2).nr25]));
assert(all([res(:,1).nr25]==[res(:,2).nr25]));
assert(all([res(:,1).nr25]==[res(:,2).nr25]));
I want to edit this to read:
@ben-willmore
ben-willmore / gist:1162167
Created August 22, 2011 11:21
fixes to fastica node
diff --git a/mdp/nodes/ica_nodes.py b/mdp/nodes/ica_nodes.py
index 3e436e1..423aea1 100644
--- a/mdp/nodes/ica_nodes.py
+++ b/mdp/nodes/ica_nodes.py
@@ -551,7 +551,7 @@ def core(self, data):
print 'Convergence after %d steps\n' % round
break
if stabilization:
- if (stroke != 0) and (convergence_fine[round] < limit):
+ if (stroke == 0) and (convergence_fine[round] < limit):
@ben-willmore
ben-willmore / gist:1150335
Created August 16, 2011 22:15
Allow pygame 1.9.1release to build against either frameworks or regular libs on OS X
diff -u -ruN pygame-1.9.1release/config_darwin.py pygame-1.9.1release-fixed/config_darwin.py
--- pygame-1.9.1release/config_darwin.py 2009-07-09 07:13:20.000000000 +0100
+++ pygame-1.9.1release-fixed/config_darwin.py 2011-08-16 22:22:46.000000000 +0100
@@ -1,60 +1,107 @@
-"""Config on Darwin w/ frameworks"""
+"""Config on Darwin without frameworks"""
-import os, sys, string
+import os, sys
from glob import glob
@ben-willmore
ben-willmore / gist:1150319
Created August 16, 2011 22:09
Allow pygame SVN to build against framework or regular libs on OS x
Index: config_darwin.py
===================================================================
--- config_darwin.py (revision 3225)
+++ config_darwin.py (working copy)
@@ -6,7 +6,7 @@
from config_unix import DependencyProg
class Dependency:
- libext = '.a'
+ libext = '.dylib'
@ben-willmore
ben-willmore / gist:1150088
Created August 16, 2011 20:26
Patch for pygame on OS X 10.7 without frameworks
diff -u -ruN pygame-1.9.1release/config_darwin.py pygame-1.9.1release-fixed/config_darwin.py
--- pygame-1.9.1release/config_darwin.py 2009-07-09 07:13:20.000000000 +0100
+++ pygame-1.9.1release-fixed/config_darwin.py 2011-08-14 15:55:00.000000000 +0100
@@ -1,60 +1,107 @@
-"""Config on Darwin w/ frameworks"""
+"""Config on Unix"""
-import os, sys, string
+import os, sys
from glob import glob