27 lines
484 B
JavaScript
27 lines
484 B
JavaScript
// Minimal inverter adapter scaffold
|
|
// Demonstrates a plug-in adapter exposing a small interface.
|
|
|
|
class InverterAdapter {
|
|
constructor(id) {
|
|
this.id = id;
|
|
}
|
|
|
|
// Example: read current state from the device (mock)
|
|
readState() {
|
|
return {
|
|
id: this.id,
|
|
outputW: 0
|
|
};
|
|
}
|
|
|
|
// Example: apply a command to the device (mock)
|
|
applyCommand(cmd) {
|
|
// no-op in MVP
|
|
return { success: true, command: cmd };
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
InverterAdapter
|
|
};
|