UNPKG

@name-industry/ni-ina219

Version:

Module for using the WaveShare UPS Raspberry Pi Hat that has an embedded Texas Instruments INA219 sensor.

35 lines (30 loc) 843 B
// V@ts-check <- has problems with 'this' in the init method for some reason /** * @class WSpowerSupplyVoltage * * @summary * WSpowerSupplyVoltage Actions * * @description * Actions for the WaveShare UPS Hat */ import WSpowerSupplyVoltageModel from "../../Domain/WSpowerSupplyVoltage/Model/index.js"; class WSpowerSupplyVoltage { constructor() { }; getPSUVoltage = async function (busVoltage, shuntVoltage) { WSpowerSupplyVoltageModel.hydrate( { busVoltage: busVoltage, shuntVoltage: shuntVoltage }, "en", true ); return { success: true, msg: "PowerSupplyVoltage", data: WSpowerSupplyVoltageModel.getCurrentValues() } } } export default new WSpowerSupplyVoltage();