Skip to content

Instantly share code, notes, and snippets.

@zarya
zarya / hass.pl
Last active November 17, 2019 13:23
use strict;
use warnings;
use Irssi;
use Irssi::Irc;
use vars qw($VERSION %IRSSI);
use LWP::UserAgent;
use IO::Socket::SSL qw();
use HTTP::Request::Common;
#!/usr/local/bin/python
import requests
import sys
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
if tag == "meta":
if attrs[0][1] == "powerstate":
port = attrs[1][1].split(",")
function sMeter(rssi,ber) {
var value
var value2
if (ber == -1 || ber == "-1" || ber == undefined || ber == "undefined") value2 = "";
else if (ber > -1) value2 = "<span title=\"BER 100%\" class=\"icon-star\" style=\"color: green\"> </span>";
else if (ber > 0.33) value2 = "<span title=\"BER 33% - 99%\" class=\"icon-star-empty\" style=\"color: yellow\"> </span>";
else value2 = "<span title=\"BER 0% - 33%\" class=\"icon-star-half\" style=\"color: red\"> </span>";
if (rssi == 0 || rssi == "0" || rssi == undefined) value = "";
else if (rssi > -63) value = '<img src="dist/img/indicator/4.png" \> S9+10dB';
<?php
function hytera_h2f($number,$nd) {
if (strlen(str_replace(" ","",$number)) == 4)
{
$hex = '';
for ($i = 0; $i < strlen($number); $i++) {
$byte = strtoupper(dechex(ord($number{$i})));
$byte = str_repeat('0', 2 - strlen($byte)).$byte;
$hex.=$byte." ";
}
<html>
<head>
</head>
<body style="background-color: #141414;">
<div style="position: absolute; overflow: hidden; left: 0px; top: 0px; border: none 0px #555; width:100%; height:600px;">
<div style="overflow: hidden; margin-top: -50px; margin-left: -25px; border: none 0px;">
</div>
<iframe width="100%" height="100%" scrolling="no" style="border: none 0px;" src="http://dashboard.haxogreen.lu/grafana/dashboard/db/main-dashboard"></iframe>
</div>
</body>
#include "ets_sys.h"
#include "driver/uart.h"
#include "osapi.h"
#include "os_type.h"
#include "user_interface.h"
#include "functions.h"
int8_t ICACHE_FLASH_ATTR
dataStrCpy(void *pDest, const void *pSrc, int8_t maxLen)
{
#define SSID "bla"
#define SSID_PASSWORD "bla"
#define user_procTaskPrio 0
#define user_procTaskQueueLen 1
#include "ets_sys.h"
#include "driver/i2c_master.h"
#include "driver/uart.h"
#include "osapi.h"
#include "os_type.h"
#include "user_interface.h"
#include "functions.h"
#include "config.h"
os_event_t user_procTaskQueue[user_procTaskQueueLen];
#include "ets_sys.h"
#include "driver/uart.h"
#include "osapi.h"
#include "at.h"
#include "key.h"
#include "gpio.h"
static volatile os_timer_t some_timer;
void some_timerfunc(void *arg)
#include "ets_sys.h"
#include "driver/uart.h"
#include "osapi.h"
#include "at.h"
#include "key.h"
#include "gpio.h"
static os_timer_t some_timer;
void some_timerfunc(void *arg)