#iot #lua #arete #smart-buildings #padi

mlua-arete-sdk

Lua bindings for the Arete SDK for smart buildings

5 releases

Uses new Rust 2024

0.1.4 Sep 26, 2025
0.1.3 Sep 19, 2025
0.1.2 Sep 13, 2025
0.1.1 Sep 5, 2025
0.1.0 Sep 4, 2025

#309 in FFI

Download history 443/week @ 2025-09-02 250/week @ 2025-09-09 260/week @ 2025-09-16 182/week @ 2025-09-23 224/week @ 2025-09-30 57/week @ 2025-10-07 168/week @ 2025-10-14 21/week @ 2025-10-21 1/week @ 2025-10-28

191 downloads per month

MIT license

515KB
354 lines

mlua-arete-sdk

Lua bindings for the Arete SDK for smart buildings.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-arete-sdk --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_arete_sdk::preload(&lua);
let script = r#"
    local arete_sdk = require('arete-sdk')
    
    local NODE_ID = 'ozr9fZbU8i7hMdjEjuTS2o'
    local NODE_NAME = 'arete-sdk-01-switch'
    
    local CONTEXT_ID = 'uRLoYsXEY7nsbs9fRdjM8A'
    local CONTEXT_NAME = 'Building 23, Office 41-B'
    
    local PADI_LIGHT_PROFILE = 'padi.light'
    
    local client = arete_sdk.Client:new('wss://dashboard.test.cns.dev:443')
    client:waitForOpen()
    local system = client:system()
    local node = system:node(NODE_ID, NODE_NAME, false)
    local context = node:context(CONTEXT_ID, CONTEXT_NAME)
    local provider = context:provider(PADI_LIGHT_PROFILE)
    provider:put('sOut', 1)
"#;
lua.load(script).exec().unwrap();

Testing

$ make check

Dependencies

~14–27MB
~432K SLoC