import * as Bluebird from "bluebird" ; import { systemBus , Message , Bus } from 'dbus-native' ; export const dbus = systemBus ( ) ; export const dbusInvoker = ( message ) : PromiseLike < any > => { return Bluebird . fromCallback ( cb => { return dbus . invoke ( message , cb ) ; } ) ; } ; export const getProperty = async ( service , objectPath , objectInterface , property ) : Promise < any > => { let message = { destination : service , path : objectPath , interface : 'org.freedesktop.DBus.Properties' , member : 'Get' , signature : 'ss' , body : [ objectInterface , property ] } ; const [ [ ] , [ value ] ] = await dbusInvoker ( message ) ; return value ; } ;