Skip to content

Instantly share code, notes, and snippets.

@ov1d1u
ov1d1u / validate_entities.py
Last active October 26, 2023 12:51
Script to validate entities in configuration files
import sys
import re
import requests
# USAGE: python3 validate_entities.py < flows.json
# Configuration
# Replace with your Home Assistant instance's address
BASE_URL = "http://homeassistant.local:8123"
@ov1d1u
ov1d1u / micstatus.py
Last active November 28, 2023 18:40
Get MacOS mic status
import time
import requests
import atomacos
sysui = atomacos.getAppRefByBundleId('com.apple.controlcenter')
hass_api_url = "https://hassio.ov1d1u.net/api/webhook/<webhook_id>"
state = { "incall": False }
while True:
import queue
from homeassistant.components import bluetooth
from bleak import BleakClient, exc
queues = {}
disconnectTasks = {}
class MessageQueue(queue.Queue):
def get(self, block=False, timeout=None):
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const definition = {
MakeGatewayInfo() mismatch (-want +got):
cmp_test.Gateway{
SSID: "CoffeeShopWiFi",
- IPAddress: s"192.168.0.2",
+ IPAddress: s"192.168.0.1",
NetMask: {0xff, 0xff, 0x00, 0x00},
Clients: []cmp_test.Client{
... // 2 identical elements
{Hostname: "macchiato", IPAddress: s"192.168.0.153", LastSeen: s"2009-11-10 23:39:43 +0000 UTC"},
{Hostname: "espresso", IPAddress: s"192.168.0.121"},
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import re
import requests
import json
import os
import sys
from datetime import datetime
@ov1d1u
ov1d1u / telepat
Created February 8, 2016 17:27
Hello!
## Canale
So, ca sa te abonezi la update-urile venite de la Telepat (cele pentru obiecte, mai jos cele pentru contexte) intai faci subscribe:
[[Telepat client] subscribe:context modelName:@"polls" classType:[IABMPoll class] withBlock:^(TelepatResponse *response) {
// context: TelepatContext-ul la care vrei sa te abonezi
// @"polls": numele modelului
// classType: tipul obiectelor pe care il astepti din subscription, pentru ca Telepat sa stie ce sa iti returneze
}];
for (UIView *subview in [[[UIApplication sharedApplication] keyWindow] subviews]) {
if ([subview isKindOfClass:NSClassFromString(@"UITransitionView")]) {
[subview removeFromSuperview];
}
}

Keybase proof

I hereby claim:

  • I am ov1d1u on github.
  • I am ov1d1u (https://keybase.io/ov1d1u) on keybase.
  • I have a public key whose fingerprint is 9407 48D8 BA04 20B1 B44B 1ADC 1AB7 465F 6C9F E257

To claim this, I am signing this object: