Skip to content

Instantly share code, notes, and snippets.

View czechdude's full-sized avatar

Petr Diviš czechdude

View GitHub Profile
#měřič spotřeby vody pro Energie
template:
- sensor:
- name: "Watermeter"
unique_id: water_meter_in_l
unit_of_measurement: L
device_class: water
state_class: total_increasing
state: "{{ states('counter.counter_water_pulses')|int }}"
# Counter
/*
control app https://x.thunkable.com/copy/e8f633a8a9a3e979025112e18446d3b4
Video: https://www.youtube.com/watch?v=oCMOYS71NIU
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp
Ported to Arduino ESP32 by Evandro Copercini
Create a BLE server that, once we receive a connection, will send periodic notifications.
The service advertises itself as: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
Has a characteristic of: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E - used for receiving data with "WRITE"
Has a characteristic of: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E - used to send data with "NOTIFY"
@czechdude
czechdude / angular-mocks.js
Created August 23, 2013 07:50
When I run unit tests with jasmine, PhantomJS stops responing, while in Chrome the unit tests run without problems. I use: VS 2010SP1, Resharper 8, PhantomJS 1.9.1.0, Jasmine 1.2rc1, angular 1.1.5, angular-mocks 1.0.6
/**
* @license AngularJS v1.0.6
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*
* TODO(vojta): wrap whole file into closure during build
*/
/**
* @ngdoc overview
@czechdude
czechdude / FileStorage.php
Created June 30, 2012 16:11
FileStorage + SQLITE3 : Fix pro Nette 0.9.7 (asi celá větev 0.9.x) pokud používáte cache a máte PHP > 5.3.x a nemůžete tam rozběhnout SQLite2
<?php
/**
* This file is part of the Nette Framework.
*
* Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
*
* This source file is subject to the "Nette license", and/or
* GPL license. For more information please see http://nette.org
* @package Nette\Caching