Skip to content

Instantly share code, notes, and snippets.

View ov1d1u's full-sized avatar

Ovidiu D. Nițan ov1d1u

View GitHub Profile
[
{
"id": "5c6c6fe6e65c4285",
"type": "inject",
"z": "9409b244d6890952",
"name": "Nowcasting alerts",
"props": [
{
"p": "payload"
},
import requests
import xml.etree.ElementTree as ET
from datetime import datetime
import argparse
import re
import logging
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@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 August 26, 2024 10:43
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
}];