Skip to content

Instantly share code, notes, and snippets.

Evgeny S jsopenrb

Block or report user

Report or block jsopenrb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View oauth.lua
local Encdec = require("encdec")
local Url = require("socket.url")
local Ltn12 = require("ltn12")
local Http = require("socket.http")
local Https = require("ssl.https")
local table, string, os, print = table, string, os, print
local error, assert = error, assert
local pairs, tostring, type, next, setmetatable = pairs, tostring, type, next, setmetatable
local math = math
View requests-lm.lua
-- Lua Requests library for http ease
local http_socket = require('socket.http')
local https_socket = require('ssl.https')
local url_parser = require('socket.url')
local ltn12 = require('ltn12')
local json = require('json')
local encdec = require('encdec')
local requests = {
@jsopenrb
jsopenrb / fire.lua
Last active Jan 26, 2017
Denver e-Ribbon Fire Lua example
View fire.lua
function send(dev, req)
local port, b1, b2, cs, data, res, err
-- checksum calculation
function getcs(b1, b2)
return 0xFF - bit.band(b1 + b2, 0xFF)
end
require('serial')
port = serial.open(dev, { baudrate = 19200 })
View heating.lua
-- extra temp offset for each mode
modeoffset = { [0] = 0, [1] = 2, [2] = 4 }
-- zone definition, each zone has 5 elements:
-- 1 = mode, 2 = temp sensor, 3 = setpoint, 4 = output, 5 = output status
zones = {
{ '7/4/3', '1/0/1', '1/1/1', '1/2/1', '1/3/1' },
{ '7/4/3', '1/0/2', '1/1/2', '1/2/2', '1/3/2' },
{ '7/4/3', '1/0/3', '1/1/3', '1/2/3', '1/3/3' },
{ '7/4/3', '1/0/4', '1/1/4', '1/2/4', '1/3/4' },
View user.dmx.lua
local luadmx = require('luadmx')
module('DMX', package.seeall)
local DMX = {}
-- default params
local defaults = {
-- storage key
skey = 'dmx_line_1',
-- RS-485 port
You can’t perform that action at this time.