Source code for festivalgrid.management.commands.provision_devices

from django.core.management.base import BaseCommand

from ...device_templates.tasmota import Tasmota

[docs]class Command(BaseCommand): help = 'Provision devices'
[docs] def add_arguments(self, parser): parser.add_argument('devices', type=str)
[docs] def handle(self, *args, **options): ips = options["devices"].strip(",").split(",") self.stdout.write("\nProvisioning %d device(s)...\n\n" % len(ips)) for ip in ips: self.stdout.write(" %s" % ip) Tasmota.provision(ip, self.stdout) self.stdout.write("\nprovisioning completed.")