Data model#
The Enody SDKs use the same device hierarchy across Rust, Python, and JavaScript. Rust is the core SDK and the reference model for host-side applications:
Environment -> Runtime -> Host -> Fixture -> Source -> Emitter
Environment#
An environment is a discovery surface.
UsbEnvironmentdiscovers USB-attached devices.WifiEnvironmentdiscovers saved-token WiFi devices.
Discovery environments can also emit arrival and departure events through
start_discovery(), stop_discovery(), and next_runtime_event(). Rust and
JavaScript device-backed methods are asynchronous because they may issue serial
or network commands.
Runtime#
A runtime is the message-passing entry point for a connected device. In host applications, runtimes are remote handles that carry a shared connection. A runtime exposes exactly one host.
Common methods:
host()connect()disconnect()is_connected()enable_logging()generate_token()
Host#
A host is a physical Enody device. EP01 is represented as a host.
Common methods:
identifier()version()fixtures()wifi_scan()wifi_join(ssid, password)
Fixture#
A fixture is an addressable light output unit.
Common methods:
identifier()sources()display(configuration, flux)
Source#
A source is an independently controllable region within a fixture.
Common methods:
identifier()emitters()display(configuration, flux)tensor()in Pythontensor()in JavaScriptplot_emitter_spectral_distributions()in Pythonplot_emitter_chromaticity_diagram()in Python
Emitter#
An emitter is a single LED channel with measured spectral data.
Common methods:
identifier()spectral_data()spectralData()in JavaScriptset_flux(flux)setFlux(flux)in JavaScripttensor()in Pythontensor()in JavaScript
Configuration and flux#
Display commands pair a configuration with a flux target.
use enody::message::{Configuration, Flux};
let configuration = Configuration::Blackbody(2700.0);
let flux = Flux::Relative(0.8);