Skip to content

Instantly share code, notes, and snippets.

View viperet's full-sized avatar
🇺🇦

Vitaly Peretiatko viperet

🇺🇦
View GitHub Profile

В файле zigbee2mqtt/node_modules/zigbee-herdsman-converters/converters/toZigbee.js добавить перед строкой RM01_light_onoff_brightness: {:

    edm_dimmer_control: {
        key: ['brightness_min', 'brightness', 'brightness_percent', 'level'],
        convertSet: async (entity, key, value, meta) => {
            value = Number(value);
            if (isNaN(value)) {
                throw new Error(`${key} value of message: '${JSON.stringify(meta.message)}' invalid`);
@viperet
viperet / concat.php
Created November 30, 2018 08:52
PHP string concatenation benchmark
<?php
function starttime() {
$r = explode( ' ', microtime() );
$r = $r[1] + $r[0];
return $r;
}
function endtime($starttime) {
$r = explode( ' ', microtime() );
$r = $r[1] + $r[0];