Per IMPLEMENTATION-ORDER.md 1.3: a quest_definition_assignees table (definition_id, child_id) with a composite primary key and FKs to quest_definitions and children replaces the single child_id column on quest_definitions. - schema.py: definitions DDL loses child_id; new assignees table joins SCHEMA_V1_STATEMENTS; the definitions table body is extracted to QUEST_DEFINITIONS_TABLE_SQL so the rebuild migration cannot drift from the canonical shape. - migrations.py: callable migrations now own their transaction and stamp via stamp_schema_version(database, version), because the rebuild must bracket itself with PRAGMA foreign_keys OFF/ON. New migration 3 creates the assignees table and, when a pre-D-008 quest_definitions still carries child_id, rebuilds the table via SQLite's canonical procedure (create, copy, move assignees, drop, rename), verifies PRAGMA foreign_key_check inside the transaction, and stamps. Migration 2 converted to the new callable contract. - dao_rules.py: QuestDefinitionsDao.create drops the child_id argument and applies assignee_child_ids atomically; set_assignee is replaced by add_assignee (idempotent, active-child validated under the connection lock), remove_assignee and list_assignees; list_by_child reads through the assignees table. - dao_instances.py: upsert validates the child against quest_definition_assignees instead of the definitions column. - tests: schema shape tests for the assignees table (columns, PK, FKs, duplicate/unknown constraints); DAO tests rewritten for the new assignment API; migration tests for the v2 -> v3 rebuild (rows and instances survive, child_id gone, foreign_key_check clean).
NestQuest - House Chaos Coordination
Home Assistant custom integration for managing chores, custody schedules, and house coordination.
Overview
NestQuest helps households coordinate daily life, chore tracking, custody schedules, and shared tasks directly within Home Assistant. Version 0.2.0 ships the integration foundation (a configuration scaffold providing the package and manifest, shared constants, a single-instance config flow, setup/unload lifecycle handling with an options-reload listener, an options flow for horizon days / day rollover time / panel idle timeout, and HACS metadata) plus its persistence layer: an integration-owned SQLite database (nestquest.db) with WAL mode and foreign keys, a versioned migration runner stamping schema version 1 across eight tables (children, admin_users, schedule_rules, task_definitions, presence_schedules, presence_overrides, task_instances, completion_events), typed DAO layers so no other feature writes raw SQL, an append-only completion-event log, and startup handling that creates a missing database, opens a valid one, and refuses — without touching a single byte — to start on a corrupt one. Sensors, calendar events, and service calls are forthcoming in later releases and are not yet part of the integration.
Installation
HACS Installation (Recommended)
- Ensure HACS (Home Assistant Community Store) is installed.
- In Home Assistant, open HACS > Integrations.
- Select the three-dots menu in the top right and click Custom repositories.
- Enter the repository URL:
https://github.com/talon2king/NestQuest - Select category Integration and click Add.
- Search for NestQuest and click Download.
- Restart Home Assistant.
Note: Development happens in the private Gitea repository (
https://code.cubecraftlabs.com/Maniacs_Mansion/NestQuest). The GitHub repository is a public mirror maintained for HACS distribution.
Manual Installation
- Download the latest release from the repository.
- Copy the
custom_components/nestquestdirectory into your Home Assistant installation'sconfig/custom_components/folder:cp -R custom_components/nestquest <config_dir>/custom_components/ - Restart Home Assistant.
Configuration
After installation and restart:
- Navigate to Settings > Devices & Services in Home Assistant.
- Click Add Integration and search for NestQuest.
- Follow the on-screen configuration flow.
Developer Setup and Testing
This project uses uv for fast Python package and dependency management.
Prerequisites
- Python 3.11 or newer
- uv installed on your machine
Setup Environment
To set up the development environment and install dependencies:
uv sync
Running Tests
Run the test suite with pytest:
uv run pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.