def status_battery():
 data = status()
 if ('TONBATT' in data):
  return (not (data['TONBATT'] == '0 Seconds'))
 return {'Error': 'Battery status not available.'}

def status_battery ( ) : data = status ( ) if ( 'TONBATT' in data ) : return ( not ( data [ 'TONBATT' ] == '0 Seconds' ) ) return { 'Error' : 'Battery status not available.' }
return true if running on battery power cli example: .