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
191 downloads per month
515KB
354 lines
mlua-arete-sdk
Lua bindings for the Arete SDK for smart buildings.
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