A simple Prometheus export that collect A/C target temperature & load power from Xiaomi Air Conditioning Companion.
It serves as a simple demo, you may expand it to other Mi devices & metrics. See python-miio's document.
#!/usr/bin/env python3 | |
import asyncio | |
from asyncio import StreamReader, StreamWriter | |
LISTEN = ('::', 8080) | |
WAIT_SECS = 3 | |
BUF_SIZE = 4096 | |
HTTP_RESPONSE = [ | |
'HTTP/1.1 200 OK', |
diff --git a/app/src/main/java/com/yubico/yubikitold/transport/usb/UsbDeviceManager.java b/app/src/main/java/com/yubico/yubikitold/transport/usb/UsbDeviceManager.java | |
index 1e5ed82..060b32f 100644 | |
--- a/app/src/main/java/com/yubico/yubikitold/transport/usb/UsbDeviceManager.java | |
+++ b/app/src/main/java/com/yubico/yubikitold/transport/usb/UsbDeviceManager.java | |
@@ -29,7 +29,7 @@ public final class UsbDeviceManager { | |
private transient UsbDevicePredicate deviceFiler = new UsbDevicePredicate() { | |
@Override | |
public boolean test(UsbDevice usbDevice) { | |
- return usbDevice.getVendorId() == 0x1050; | |
+ return usbDevice.getVendorId() == 0x1050 || usbDevice.getVendorId() == 0x20A0; |
// ==UserScript== | |
// @name E-Hentai Prefetch Next Page | |
// @namespace Violentmonkey Scripts | |
// @match https://e-hentai.org/s/* | |
// @match https://exhentai.org/s/* | |
// @grant none | |
// @version 0.2.0 | |
// @author sorz | |
// @description Prefetch image file on the next page for faster browsing. | |
// ==/UserScript== |
from datetime import datetime | |
import binascii | |
import logging | |
import io | |
def _parse_fields(raw): | |
"""Return a iterators of (id, value).""" | |
raw = io.BytesIO(raw) | |
while True: |
#!/usr/bin/env python3 | |
import sys | |
import socket | |
from subprocess import Popen, PIPE | |
def main(): | |
sock = socket.fromfd(3, socket.AF_INET, socket.SOCK_STREAM) | |
while True: |
A simple Prometheus export that collect A/C target temperature & load power from Xiaomi Air Conditioning Companion.
It serves as a simple demo, you may expand it to other Mi devices & metrics. See python-miio's document.
/* | |
DHT22.cpp - Library for DHT22/DHT11 relative humidity & temperature sensor. | |
Created by Sorz. 2014-07-18. | |
*/ | |
#include "Arduino.h" | |
#include "DHT22.h" | |
TempHumiSensor::TempHumiSensor(int pin) | |
{ | |
pinMode(pin, INPUT_PULLUP); |
#!/usr/bin/env python | |
#encoding: utf-8 | |
import urllib2 | |
from base64 import b64decode | |
LIST_URL = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt' | |
BLACK_FILE = 'gfw.url_regex.lst' | |
WHITE_FILE = 'cn.url_regex.lst' |
diff --git a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryDetailParser.java b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryDetailParser.java | |
index 27f9a671..1f541301 100644 | |
--- a/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryDetailParser.java | |
+++ b/app/src/main/java/com/hippo/ehviewer/client/parser/GalleryDetailParser.java | |
@@ -73,7 +73,7 @@ public class GalleryDetailParser { | |
private static final GalleryTagGroup[] EMPTY_GALLERY_TAG_GROUP_ARRAY = new GalleryTagGroup[0]; | |
private static final GalleryCommentList EMPTY_GALLERY_COMMENT_ARRAY = new GalleryCommentList(new GalleryComment[0], false); | |
- private static final DateFormat WEB_COMMENT_DATE_FORMAT = new SimpleDateFormat("dd MMMMM yyyy, HH:mm z", Locale.US); | |
+ private static final DateFormat WEB_COMMENT_DATE_FORMAT = new SimpleDateFormat("dd MMMMM yyyy, HH:mm", Locale.US); |