add the collector as a management command

This allows the command to be called by cron or a similar external tool
This commit is contained in:
Andreas Zweili 2019-10-20 22:51:35 +02:00
parent 9d01af07b9
commit 03b7cb5325
1 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,8 @@
from django.core.management.base import BaseCommand, CommandError
from collector.collector import values_to_db
class Command(BaseCommand):
help = 'Writes the sense hat values to the db.'
def handle(self, *args, **options):
values_to_db()