# Generated by ChatGPT
from decimal import Decimal

from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Thermometer",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=128)),
                ("slug", models.SlugField(unique=True)),
                ("description", models.TextField(blank=True)),
                ("unit", models.CharField(blank=True, max_length=16)),
                (
                    "report_regex",
                    models.CharField(
                        blank=True,
                        help_text=(
                            "Regex used to parse sensor readings from reports. "
                            "Use a named group 'value' or the first capture group."
                        ),
                        max_length=255,
                    ),
                ),
                (
                    "report_scale",
                    models.DecimalField(
                        decimal_places=6,
                        default=Decimal("1"),
                        help_text="Multiplier applied to parsed readings.",
                        max_digits=10,
                    ),
                ),
                (
                    "display_precision",
                    models.PositiveSmallIntegerField(
                        default=1,
                        help_text="Number of decimal places to display for readings.",
                    ),
                ),
                (
                    "last_reading",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=8, null=True
                    ),
                ),
                ("last_read_at", models.DateTimeField(blank=True, null=True)),
                ("is_active", models.BooleanField(default=True)),
            ],
            options={
                "verbose_name": "Thermometer",
                "verbose_name_plural": "Thermometers",
                "ordering": ["name"],
            },
        ),
    ]
