# Generated by Django 3.0.1 on 2020-01-24 16:04

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='LightBulb',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=64)),
                ('address', models.CharField(blank=True, default='', max_length=64, null=True)),
                ('port_number', models.CharField(default='-', max_length=4)),
                ('state', models.CharField(default='-', max_length=1000)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lightbulb', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='LightBulbSettings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reset', models.IntegerField(blank=True, choices=[(1, 'Reset')], null=True)),
                ('default_state', models.CharField(choices=[('off', 'Off'), ('on', 'On')], default='off', max_length=8)),
                ('auto_off', models.IntegerField(blank=True, default=0, null=True)),
                ('state', models.CharField(default='-', max_length=1000)),
                ('schedule', models.BooleanField(default=False)),
                ('schedule_rules', models.CharField(blank=True, default='', help_text='Format: 0900-on,0930-off', max_length=1000, null=True)),
                ('lightbulb', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='lightbulb_settings', to='lights.LightBulb')),
            ],
        ),
        migrations.CreateModel(
            name='LightBulbRelay',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('set_state', models.CharField(choices=[('off', 'Off'), ('on', 'On'), ('toggle', 'Toggle')], default='off', max_length=8)),
                ('timer', models.IntegerField(blank=True, default=0, null=True)),
                ('state', models.CharField(default='-', max_length=1000)),
                ('lightbulb', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='lightbulb_relay', to='lights.LightBulb')),
            ],
        ),
        migrations.CreateModel(
            name='LedLight',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=64)),
                ('address', models.CharField(blank=True, default='', max_length=64, null=True)),
                ('port_number', models.CharField(default='-', max_length=4)),
                ('state', models.CharField(choices=[('-', 'inactive'), ('0', 'Off'), ('1', 'On'), ('2', 'blink')], default='-', max_length=1)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ledlight', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['state', 'owner'],
            },
        ),
    ]
