UNPKG

@name-industry/ni-ina219

Version:

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

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