# Generated by Django 3.0.6 on 2020-05-22 12:00

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('topic', models.CharField(max_length=200)),
                ('protocol', models.CharField(max_length=16)),
                ('deviceid', models.CharField(max_length=64)),
                ('localkey', models.CharField(max_length=64)),
                ('ip', models.CharField(max_length=32)),
                ('hass_discovery', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Dpstype',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('valuetype', models.CharField(max_length=16)),
                ('range_min', models.IntegerField(default=0)),
                ('range_max', models.IntegerField(default=255)),
                ('discoverytype', models.CharField(max_length=16)),
            ],
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('value', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='Dps',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.IntegerField()),
                ('value', models.CharField(max_length=16)),
                ('via', models.CharField(max_length=8)),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tuyamqtt.Device')),
                ('dpstype', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tuyamqtt.Dpstype')),
            ],
        ),
        migrations.AlterField(
            model_name='device',
            name='ip',
            field=models.GenericIPAddressField(),
        ),
        migrations.AlterField(
            model_name='device',
            name='protocol',
            field=models.CharField(choices=[('3.1', '3.1'), ('3.3', '3.3')], default='3.3', max_length=16),
        ),
        migrations.AlterField(
            model_name='dps',
            name='via',
            field=models.CharField(choices=[('tuya', 'Tuya'), ('mqtt', 'MQTT')], default='tuya', max_length=8),
        ),
        migrations.AlterField(
            model_name='dpstype',
            name='discoverytype',
            field=models.CharField(choices=[('light', 'Light'), ('switch', 'Switch'), ('sensor', 'Sensor'), ('binary_sensor', 'Binary Sensor')], default='light', max_length=16),
        ),
        migrations.AlterField(
            model_name='dpstype',
            name='valuetype',
            field=models.CharField(choices=[('bool', 'Boolean'), ('int', 'Integer'), ('str', 'String')], default='bool', max_length=16),
        ),
    ]
