onstar2mqtt
onstar2mqtt copied to clipboard
Support exiting instead of sleeping
I have multiple cars, so would like to call this with a cron job, once for each car. You could handle this case by checking if the ONSTAR_REFRESH environment variable is 0 (or -1) and instead of sleeping, just exit, eg:
if (onstarConfig.refreshInterval >= 0)
logger.info('Updates complete, sleeping.');
else
return process.exit();