# Generated by Django 4.2 on 2026-02-09 06:31

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


class Migration(migrations.Migration):

    dependencies = [
        ("devices", "0002_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="device",
            name="battery",
            field=models.IntegerField(default=0, verbose_name="电量百分比"),
        ),
        migrations.AddField(
            model_name="device",
            name="icon",
            field=models.CharField(
                blank=True, max_length=100, null=True, verbose_name="设备图标"
            ),
        ),
        migrations.AddField(
            model_name="device",
            name="is_ai",
            field=models.BooleanField(default=True, verbose_name="是否AI设备"),
        ),
        migrations.AddField(
            model_name="device",
            name="is_online",
            field=models.BooleanField(default=False, verbose_name="是否在线"),
        ),
        migrations.CreateModel(
            name="DeviceSettings",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "nickname",
                    models.CharField(
                        blank=True, max_length=50, null=True, verbose_name="设备昵称"
                    ),
                ),
                (
                    "user_name",
                    models.CharField(
                        blank=True, max_length=50, null=True, verbose_name="用户称呼"
                    ),
                ),
                ("volume", models.IntegerField(default=50, verbose_name="音量")),
                ("brightness", models.IntegerField(default=50, verbose_name="亮度")),
                (
                    "allow_interrupt",
                    models.BooleanField(default=True, verbose_name="允许打断"),
                ),
                (
                    "privacy_mode",
                    models.BooleanField(default=False, verbose_name="隐私模式"),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "device",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="settings",
                        to="devices.device",
                        verbose_name="设备",
                    ),
                ),
            ],
            options={
                "verbose_name": "设备设置",
                "verbose_name_plural": "设备设置",
                "db_table": "device_settings",
            },
        ),
        migrations.CreateModel(
            name="DeviceWifi",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("ssid", models.CharField(max_length=100, verbose_name="WiFi名称")),
                (
                    "is_connected",
                    models.BooleanField(default=False, verbose_name="是否已连接"),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="创建时间"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "device",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="wifi_list",
                        to="devices.device",
                        verbose_name="设备",
                    ),
                ),
            ],
            options={
                "verbose_name": "设备WiFi",
                "verbose_name_plural": "设备WiFi",
                "db_table": "device_wifi",
                "unique_together": {("device", "ssid")},
            },
        ),
    ]
