Skip to content

Instantly share code, notes, and snippets.

@tetsuyainfra
tetsuyainfra / gist:31f8663a1a59fd56ef2e53c6a981c52e
Created January 8, 2023 11:25
switchbot Plug mini AdvertisementData
import asyncio
from pprint import pprint as pp
from bleak import BleakScanner
from bleak.backends.scanner import AdvertisementData
async def main():
print("scanning for 5 seconds, please wait...")
devices = await BleakScanner.discover(return_adv=True)
@tetsuyainfra
tetsuyainfra / mingw.sh
Created January 9, 2023 17:33 — forked from jeroen/mingw.sh
mingw-w64 cross compile
# We use Ubuntu 14.04 to build a native gcc for win32 with multilib support
#
# Based on:
# http://sourceforge.net/p/mingw-w64/wiki2/Native%20Win64%20compiler/
# http://sourceforge.net/p/mingw-w64/code/HEAD/tree/stable/v3.x/mingw-w64-doc/howto-build/mingw-w64-howto-build.txt?format=raw
#
# Cross compiling notes:
# - The minor version of gcc must match that of our cross compiler (4.8 in this case)
# - Important parameters: http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html
#