Developer docs mentioned Redis as a requirement without distinguishing
between local development (where you install it yourself) and Docker
deployment (where it is bundled and managed by supervisord). This caused
confusion for a user who set up an external Redis server not realizing
the Docker image already includes one.
Closes#241
* finished Items and Locations
* finish maintenance, labels and start notifier
* finish v1 of HomeBox Client API
* sync now creates and updates entities and entities attributes
* create sync for homebox item attachments
* finish homebox integration
* finish test implementation
* Improve Homebox API client quality and pattern conformance
Align the Homebox integration with patterns established by the existing
Home Assistant (HASS) integration, and fix several minor issues found
during code review of PR #249:
- Assert required API options in HbClient.__init__ instead of silently
logging a warning, matching the HASS client's defensive pattern
- Add warning log when login response lacks a token to aid debugging
- Translate Portuguese log message to English for consistency
- Reference HbClient constants in factory instead of magic strings
- Initialize all cache lists in HomeBoxManager.__init_singleton__
- Update factory test to work with constant references on mock class
* Fix sync bugs and remove dead code in Homebox converter
- Fix attachment order_id overlap: fields and attachments each
enumerated from 0 independently, causing interleaved display since
EntityAttribute orders by order_id. Attachments now start after the
last field index.
- Fix variable shadowing in _sync_helper_entity_attributes where the
loop variable 'hb_attachment' was immediately reassigned by tuple
unpacking on the next line.
- Remove unused _create_entity_attributes_from_hb_fields method, which
was superseded by the sync code using hb_item_to_attribute_field_list.
* Fix entity edit dialog for externally managed entities
HomeBox entities have non-editable attributes with disabled HTML form
fields. Browsers omit disabled fields from POST data, which caused
AttributeForm.clean() to see empty values and raise spurious validation
errors when updating the EntityType.
- Skip validation for non-editable attributes in AttributeForm.clean(),
since save() already short-circuits without writing for these
- Add suppress_add_new property to AttributeForm to control whether the
"Add New" attribute card is shown, following the existing pattern of
display-hint properties (suppress_history, show_as_editable, etc.)
- Pass can_add_custom_attributes through form_kwargs in the entity
formset so the form can suppress the add-new card for externally
managed entities even after a bound form re-render
* Add HomeBox integration to documentation
Add HomeBox alongside Home Assistant and ZoneMinder across all
user-facing and developer documentation: Integrations guide, Features,
FAQ, Installation, architecture overview, integration guidelines, and
service patterns.
Also remove stale reference to non-existent hi.services.weather module
from integration guidelines example list.
---------
Co-authored-by: Anthony Cassandra <github@cassandra.org>
* Added duration time to video browse timeline.
* Fixed date/time display bug. Tweaks to video stream display points.
* Added correlation role/id for better video browse semantics.
* Fix weather module async/sync issues and enable parallel test execution
- Convert weather tests to AsyncTaskTestCase for proper async handling
- Add async version of weather alerts enabled check
- Fix cache interference in parallel tests with unique test identifiers
* Added 18+ new entity type items, svg and visual display configs.
* Added EntityType visual browser and improved some SVGs.
* Added small appliance entity type. Location edit mode button tweak.
* Updated initial profiles. A few more UI tweaks.
* Added new home profile icon images for upcoming new start page.
* New start page design and structure. New profiles app created (stub).
* First time sidebars/modals. ProfileManager JSON docs and parsing.
* First working ProfileManager. WIP
* Added mechanisms for knowing when to show first-time help content.
* Refactor to clean up initial flows and intro help display.
* New DevTools views structure. Added stub for profile snapshot tool.
* Created initial profiel snapshot generator devtool.
* Rationalized profile generation and parsing with shared constants.
* Fixed location SVG path issues in predefined profiles.
* Improved unit tests for ProfileManager.
* Added SVG fragment install and generation for predefined profiles.
* Fixed unit tests depending on MEDIA_ROOT.
* Fixed remaining unit tests for MEDIA_ROOT isolation.
* Moved JSON initialization profiles to 'assets' dir.
* Refactored all the help content and added view mode ref dialog.
* Add JavaScript unit tests for auto-view.js using QUnit
- Set up QUnit testing framework with local vendoring (no CDN dependency)
- Create comprehensive test suite for auto-view.js core functions:
* throttle() - timing behavior and edge cases
* shouldAutoSwitch() - idle timeout decision logic
* isPassiveEventSupported() - feature detection and caching
* recordInteraction() and state management functions
- Add test runner HTML file that works offline
- Document testing approach and usage in README.md
- All tests focus on business logic, avoid testing framework internals
- Establishes reusable pattern for testing other JS modules
* Fix test assertion for shouldAutoSwitch 60s threshold behavior
The shouldAutoSwitch function uses >= comparison, so at exactly 60 seconds
it returns true (should auto-switch). Updated test to match actual behavior.
Also added Node.js test runner for command-line testing capability.
* Add master test runner for all JavaScript tests
- Created test-all.html that runs all JavaScript module tests in one page
- Updated README.md with improved workflow for single-URL testing
- Added instructions for adding future JavaScript modules to master runner
- Maintains individual test runners for focused debugging
This addresses the practical concern of needing to visit multiple URLs
as JavaScript test coverage grows.
* Organize JavaScript testing documentation
- Created high-level documentation at docs/dev/frontend/javascript-testing.md
- Covers testing philosophy, framework choice, and best practices
- Uses auto-view.js as reference implementation example
- Streamlined tests/README.md to focus on practical usage
- Follows project documentation organization patterns
- Maintains concise, maintainable approach with code references
* Remove redundant README.md, consolidate all JS testing docs
- Removed src/hi/static/tests/README.md (duplicate content)
- Made docs/dev/frontend/javascript-testing.md completely self-contained
- Added detailed code examples for adding new tests
- Single source of truth for JavaScript testing documentation
* Add comprehensive JavaScript unit tests for high-value modules
- svg-utils.js: 150+ test cases for SVG transform string parsing with regex edge cases
- main.js: Tests for generateUniqueId, cookie parsing/formatting with URL encoding
- video-timeline.js: Tests for VideoConnectionManager array logic and caching algorithms
- watchdog.js: Tests for timer management and restart logic simulation
- Updated test-all.html with proper module loading order (main.js first)
- Fixed svg-utils test assertions to match actual regex behavior
- Enhanced Node.js test runner with better mocking (though some modules too DOM-heavy)
All JavaScript tests now pass in browser - establishes comprehensive testing
coverage for business logic functions across multiple modules.
* Add JavaScript testing documentation links
- Added link to javascript-testing.md in frontend-guidelines.md
- Added link to javascript-testing.md in testing-guidelines.md
- Ensures JavaScript testing approach is discoverable from main guideline docs
* Fixed bug for audio signal not being cleared.
* Added better server-to-client config interactions.
* New install and update scripts. Supporting GitHub actions and docs.
* Refactor to rationalize server and client environment config.
* Added missing debug setting guard around JS debug.log() messages.
* Dealt with packages having deprecated pip install method.
* Bug fix and some documentation improvements.
* Addd model diagrams.
* Documentation Updates and DB utility scripts added.
* Updated documentation.
* Documentation refinements.
* Added new screenshot images and updated docs.
* Added linkk to helper data export scripts.
* Checkpoint: basic integration attribute editing integrated.
* Changed the integrations manage page layout for new editing.
* Improved integrations first time use flows/views.
* Added modal attribute editing for enabling integration.
* Fixed extraneous config page section.
* Added attribute editing options for integartion enable modal.
* Tweaks to integrations editing pages.
* Added left column option for main attribute edit content pane.
* Better styling for vertical tabs: settings and integration pages.
* Removed code made obsolete with new attribute editing framework.
* More obsolete code removal.
* Added missing log suppression for many test files.
* Added first time edit message. CSS file re-org too.
* Improved the editing help modal styling/layout. Added more icons.
* Implement Configuration Settings redesign with sticky header + tabs
- Add allow_reordering parameter to AttributeForm to control reorder controls
- Create ConfigEditFormHandler for unified multi-formset handling
- Create ConfigEditResponseRenderer for page-based response generation
- Add system_settings_redesigned.html template with sticky header + tabbed interface
- Update ConfigSettingsView to use helper classes following Entity/Location patterns
- Disable attribute reordering for system-defined config attributes
- Maintain existing URL structure and form submission behavior
* Fix AttributeEditContext integration with SubsystemAttributeEditData
- Create SubsystemAttributeEditContext for proper template context
- Add SubsystemAttributeEditData dataclass to cleanly pair formsets with contexts
- Update form handler and response renderer to use dataclass approach
- Simplify template logic by preparing data structure on server side
- Remove complex template logic in favor of clean dataclass properties
Fixes AttributeError: 'str' object has no attribute 'history_url_name'
* Add missing URL patterns for AttributeEditContext integration
- Add subsystem_attribute_history_inline and subsystem_attribute_restore_inline URL patterns
- Create SubsystemAttributeHistoryInlineView and SubsystemAttributeRestoreInlineView
- Follow Entity/Location pattern for inline history and restore functionality
- Resolves NoReverseMatch error for subsystem_attribute_history_inline URL
Fixes django.urls.exceptions.NoReverseMatch for inline attribute history URLs
* Tweaks for getting backend structure in place. WIP
* Config attrribute config mostly working, but still WIP.
* Good checkpoint on config attribute editing. Works, but WIP.
* Moved config settings to vertical tabs for subsystems.
* Added selected settings tab restoration url strategy.
* Added setting page error count badges to tabs.
* Tweaks to config page entry point and labeling.
* Added auto-dismiss settings update success message.
* Major refactor of attr-v2-modal.js to remove global namespacing.
* Fixed attr-v2 async initialization issue.
* CONverting magic stricts to constants.
* Refactor attribute javascript files to be better organized.
* Fixed ENTER key submit suppression for attributes. Dead code removal.
* Cleaned up all shared temp,ate id, class and selectors.
* Refactor: Attribute editing javascript message posting.
* Removed legacy config attribute history modal views.
* Refactor for better attributeb editing response code organization.
* Interim Refactor: Simple general attribute view working. WIP
* Refactor to introduce attribute page vs. item editing contexts.
* Have Entity and Location converted to refactored attribute editing.
* Checkpoint on converting Subsystem to new attribute editing. WIP
* Completed major attribute editing refactoring.
* Working on unit tests for new attribute refactor. WIP
* Fixed some unit tests. Tests are WIP though.
* Miscellaneous cleanup tasks.
* Fixed unit tests, linting and upload file deletion bug.
* Implement template generalization for Entity/Location attribute editing
Add AttributeEditContext pattern enabling ~95% code reuse between Entity
and Location editing modals while maintaining type-safe owner-specific access.
- Add AttributeEditContext base class and owner-specific implementations
- Create generic edit_content_body.html template with extensible blocks
- Add template filters/tags for dynamic method calls and URL generation
- Update Entity/Location handlers to provide generalized context
- Replace specific templates to extend generic version
- Fix file upload and history restore template context issues
All Location tests (139/139) and Entity editing tests (17/17) passing.
* Updated documentation. Generic Attribute Editing, Testing
* Added unit tests and fixed linting errors.
* Rationalized view vs. edit mode names and directory organization.
* Fixed JS issues with previous refactor.
* More refactoring to rationalize view vs. edit mode.
* Yet more refactoring to rationalize view vs. edit mode.
* Continued refactoring to Javascript bug fixes for refactoring.
* Fixed a couple unit tests and linting errors.
* Document design workflow process and update CLAUDE.md
- Add comprehensive design workflow documentation in docs/dev/workflow/design-workflow.md
- Update CLAUDE.md with design work documentation workflow section
- Establishes data/design/issue-{number}/ pattern for local work
- Documents GitHub issue attachment vs comment organization
- Provides reusable process for future design-focused issues
- Maintains repository cleanliness while enabling design iteration
* Snapshpt fo semi-working new entity and attribute edit modal.
* Refactored new forms to remove duplication. Fixed some textarea bugs.
* Fixed textarea attributes to prevent data corruption.
* Fixed new attribute validation error handling.
* Moved Entity attribute formset non-file filtering closer to def.
* Styling impovements.
* Added attribute value history browsing and restoring.
* Fixed styling on new entity edit modal header area.
* Refactored the messy and confusing new entity edit modal.
* Fixed icon in new attruibute form.
* Attribute Edit style changes.
* Fixed bad claude factoring. Fixed CSRF file upload issue.
* Added scroll-to in antinode.js whic helped fix file upload UX issue.
* Fixed styling of the add new attribute card for the 'mark as secret'.
* Added modified field forms styling for new entity edit modal.
* Fixed bug in secret attribute readonly editing logic.
* Added file attribute value editing to new entity edit modal.
* Removed legacy EntityEditView and related code.
* Refactor to remove EntityEditData.
* Refactor to rename: EntityDetailsData -> EntityEditModeData
* More refactoring for name change from "details" to "edit mode"
* Removed debug log messages. Doc typo fix.
* Refactored entity views to add helper classes.
* Coded cleanup and test fixes.
* Refactored to replace use of hardcoded DOM ids, classes, selectors.
* Refactorings: better naming removed debug messages.
* Renamed "property" to "attribute".
* Fixed unit test gaps.
* Replaced hardcoded form field prefixes with common access.
* Added EntityTransitionType to replace brittle "magic" strings.
* Tweaks on display names for entity edit modal.
* Added missing __init__.py to nested test dirs. (New failures found.)
* Working on fixing unit tests: checkpoint. WIP
* Fixed units tests
* Removed mocking from soem unit tests.
* Removed partial V2 implementation mistake from entity edit work.
* Added testing doc about lessons learned.
* Added a bunch of testing-related documentation.
* Fixed test expectation for LocationAttributeUploadView invalid upload
Updated test to expect 200 status with modal form response instead of 400 error, aligning with new form error handling behavior from entity attribute redesign.
* Implement inline SVG icon system with template tags
- Add dedicated icons.py template tag with validation and accessibility
- Create 10 SVG icon templates for common UI elements
- Add comprehensive CSS classes integrated with existing variables
- Replace HTML entities in alert banner and attribute form
- Support semantic colors, multiple sizes, and accessibility attributes
- Fully self-contained with no external dependencies
* Fix linting issues in icons.py template tag
* Complete icon standardization across all templates and JS files
- Replace all HTML entities (+, ▲, ▼, 📷, ▶, ⏱) with standardized SVG icons
- Replace all emojis in templates (🦊, 🎯, 🧭, 🔒, 🛡️, 💡, 📹) with proper icons or text
- Replace emoji debug prefixes in JS with consistent [AUDIO] text prefixes
- Add {% load icons %} to all modified templates following Django conventions
- Maintain accessibility with proper aria-label attributes throughout
- All templates now use consistent icon system with semantic sizing and colors
* Fix missing icons template tag in event history modal
Resolves template rendering errors in event history views by adding
missing {% load icons %} directive to event_history.html modal template.
This completes the icon standardization refactor (Issue #119) ensuring
all templates properly load the icons template tag before using {% icon %}.
* Add icon usage guidelines to templates documentation
Documents when and how to use the standardized icon system,
including requirements and basic example usage.
* Improve pagination template styling and icons
Replace HTML entities in pagination with standardized SVG icons and
apply app primary color theming. Creates consistent button heights
and responsive icon/text layout.
Changes:
- Add chevron-left, chevron-right, chevron-double-left, chevron-double-right icons
- Update pagination template to use {% icon %} tags instead of HTML entities
- Add pagination CSS overrides using app primary color variables
- Fix responsive layout to show single icon per button with conditional text
- Ensure consistent 24x24 viewBox and template structure for all chevron icons
* Add UX-focused icon usage guidelines to templates documentation
Establishes clear principles for when to use icons based on action types
rather than object specificity. Emphasizes consistency and accessibility
while providing practical examples for common use cases.
* Add essential icons and implement high-impact UX improvements
Phase 3: Add missing essential icons (edit, delete, save, cancel, close)
Phase 4: Implement critical UX improvements:
- Modal close buttons now use semantic close icon (icon-only)
- Primary action buttons (ADD NEW RULE, EDIT) include appropriate icons
- Table delete buttons use semantic delete icon (icon-only for space)
- Modal cancel buttons include cancel icon
- Modal submit buttons include action-specific icons
Follows established UX principle: action type determines icon,
with icon-only for space-constrained areas (modals, tables).
* Complete UX-focused icon improvements with comprehensive documentation
Phase 5: Finalize implementation and documentation
- Complete modal form icon improvements (edit forms now use save icon)
- Update Templates.md with comprehensive examples showing icon usage patterns
- Document icon-only vs icon+text usage patterns with clear examples
- Reference authoritative source for available icons list
All 1,617 tests passing. UX-focused icon rationalization complete.
* Add icons to remaining action buttons following UX guidelines
- Add upload icon for file upload actions
- Add icons to all ADD, CREATE, UPDATE buttons
- Add icons to DELETE actions for consistency
- Skip icons for acknowledgment buttons (OK, DONE) per guidelines
- All 1617 tests passing
* Remove temporary test database files
* Added icon browing UI testing page.
* Fixing linting newline issues.
* Implement Phase 1 & 3 of auto-view switching feature
- Add TransientViewSuggestion dataclass to console transient_models
- Create TransientViewManager singleton for managing view suggestions
- Add auto-view console settings (enabled, idle timeout, duration)
- Add console helper methods for auto-view settings
- Modify API status endpoint to include transient view suggestions
- Create auto-view JavaScript module with user interaction tracking
- Integrate auto-view with status polling system
- Add CSS styling for auto-view indicator
- Use antinode.js pattern for asynchronous content loading
* Implement Phase 2: AlertManager integration with auto-view switching
- Integrate AlertManager with TransientViewManager for EVENT alarms
- Add auto-view suggestion logic for motion/movement detection alarms
- Implement camera URL resolution using sensor_id from alarm source details
- Create extensible structure for future WEATHER/CONSOLE alarm support
- Replace TODO comment with actual implementation using recent alarms
- Use alarm priority and type for suggestion priority and trigger reason
* Fix flake8 linting issues
- Fix console settings parameter ordering to include value_range_str
- Fix transient_view_manager.py indentation and line continuation issues
- Add newline at end of file
* Add high-value unit tests and fix missing configurations
- Create focused unit tests for TransientViewManager singleton behavior
- Test priority-based suggestion replacement business logic
- Add integration tests for AlertManager with TransientViewManager
- Test motion detection alarms trigger auto-view suggestions
- Test alarm priority propagation to suggestion priority
- Add auto-view.js to Django pipeline configuration in js_hi_grid_content
- Fix SecurityLevel enum values (OFF instead of DISARMED)
- Ensure proper test isolation for singleton pattern tests
* Fix test isolation issues in integration tests
- Reset singleton instances properly between test iterations
- Ensure clean state for each alarm priority test
* Simplify integration tests and fix timezone issues
- Use timezone-aware datetimes for Django compatibility
- Simplify complex integration tests to focus on actual business logic
- Test priority handling and suggestion replacement directly
- Remove overly complex mocking that didn't add value
- All tests now pass reliably
* Refactor antinode.js to add public loadAsyncContent API for programmatic content loading
- Add AN.loadAsyncContent() method for JavaScript-initiated DOM replacement
- Update auto-view.js to use the new public API instead of internal functions
- Remove unnecessary fallback logic and references to internal handleNewContentAdded
- Rewrite antinode.js documentation to be comprehensive and well-structured
- Document all features including the new programmatic API
- Preserve detailed version support explanation in dedicated section
* Updated copyright dates.
* Refactor auto-view switching with improved encapsulation
Move responsibility boundaries to better encapsulate auto-view logic:
**Alert Model:**
- Add get_view_url() method to encapsulate view URL generation
- Move URL extraction logic from AlertManager to Alert model
- Add comprehensive documentation about HiGridView constraint
- Handle EVENT alarm source with sensor_id mapping to camera URLs
**TransientViewManager:**
- Add consider_alert_for_auto_view() method with all business logic
- Move auto-view decision making from AlertManager
- Centralize settings access and alert type filtering
- Handle motion detection filtering and URL validation
**AlertManager:**
- Simplify to coordinator role, just delegates to TransientViewManager
- Remove auto-view decision logic and URL generation methods
- Clean delegation: if new_alert exists, consider it for auto-view
**Test Coverage:**
- Add high-value business logic tests for Alert.get_view_url()
- Add TransientViewManager decision logic tests with realistic scenarios
- Add AlertManager delegation tests (some test isolation issues remain)
- Remove obsolete integration tests for old implementation
**Technical Improvements:**
- Better separation of concerns with each class owning its domain logic
- Clear constraint documentation where URLs are generated
- Extensible design for future alarm source types (WEATHER, etc.)
- Mock only at system boundaries following testing best practices
Note: Some unit tests need refinement for test isolation - will be addressed separately.
* Fix auto-view switching unit tests and improve test reliability
- Replace excessive mocking with real behavior testing in AlertManager delegation tests
- Fix state pollution between tests by adding proper cleanup in setUp/tearDown methods
- Clear singleton state for both AlertManager and TransientViewManager between tests
- Add proper settings mocking for tests running in full suite context
- Fix test data to ensure separate alerts are created for proper testing
- Remove unused imports and variables to pass flake8 quality checks
- Improve test isolation following testing best practices from docs/dev/Testing.md
All auto-view related tests now pass consistently both in isolation and when run together.
* Refine auto-view switching implementation and fix test issues
- Fix singleton test isolation issues in alert and notification manager tests
- Remove unused AUTO_VIEW_IDLE_TIMEOUT backend setting (frontend handles idle detection)
- Add event throttling and passive listeners to auto-view.js for better performance
- Clean up test setup code and improve reliability
- All 1521 tests now pass, flake8 clean
This refinement improves performance and removes unnecessary backend configuration
while maintaining full functionality of the auto-view switching feature.
* Update CLAUDE.md to use Makefile targets for tests and linting
Replace direct Django/flake8 commands with make test and make lint
to eliminate directory path issues and improve reliability
* Fix new alert detection by tracking queue insertion time
The alert system was missing new alerts due to timing differences between
when events occur and when they get added to the alert queue. The client's
"since" timestamp was newer than the event's original timestamp, causing
alerts to be filtered out even though they were newly added to the queue.
Changes:
- Add queue_insertion_datetime field to Alert class
- Set queue_insertion_datetime when alerts are added to AlertQueue
- Update get_most_important_unacknowledged_alert to use queue_insertion_datetime
instead of start_datetime for "new alert" detection
- Preserve existing behavior for get_most_recent_alarm (uses alarm timestamps)
This ensures new alerts are properly detected regardless of processing delays
between event occurrence and queue insertion.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Simplify auto-view alert filtering logic
Remove brittle string-based filtering in TransientViewManager. The event
subsystem already filters alerts based on user-defined rules, so any alert
that reaches the TransientViewManager should be considered a valid candidate
for auto-view switching.
Changes:
- Remove alarm type and source filtering from _should_alert_trigger_auto_view
- Trust the event subsystem's upstream filtering based on user preferences
- Only verify that alerts have valid data (first_alarm exists)
- Let configuration settings and view URL availability be the only filters
This respects separation of concerns and removes unnecessary duplication of
filtering logic between the event and view management subsystems.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update test description to reflect actual behavior
The test was checking that non-motion alerts don't trigger auto-view, but
after simplifying the filtering logic, the test still passes because these
alerts don't have valid camera view URLs. Updated the test description to
accurately reflect what's being tested - alerts without view URLs are handled
correctly.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Refactor view URL generation to fix ZoneMinder auto-view issues
- Move view URL logic from Alert to Alarm class for better encapsulation
- Remove AlarmSource.EVENT restriction allowing all alarm types to have view URLs
- Add sensor_id field to AlarmSourceDetails for clean data propagation
- Create ViewUrlUtils utility class with proper entity/sensor relationship traversal
- Update Event.to_alarm to propagate sensor_id from SensorResponse
- Add comprehensive tests for ViewUrlUtils with proper database setup
Fixes issue where ZoneMinder motion detection events returned None for get_view_url
due to alarm source filtering and missing sensor_id propagation.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix ViewUrlUtils bugs and remove obsolete tests
- Fixed entity relationship name from entity_states to states
- Fixed filtering to use entity_state_type_str field instead of property
- Simplified tests to use actual URL generation instead of excessive mocking
- Removed obsolete alert view URL tests that used fake sensor IDs
- All 7 comprehensive ViewUrlUtils tests now pass
The ViewUrlUtils now correctly detects video stream capabilities and generates
proper URLs for ZoneMinder motion detection events.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* A few debug logging improvements while debugging.
* Add development data injection system for frontend testing
Creates a safe, external mechanism to inject test data into API responses
for frontend testing without modifying backend state or triggering Django
auto-reload. Uses dual safety checks (DEBUG + DEBUG_FORCE flags) to prevent
production use.
Components:
- DevInjectionManager utility class for cache/file-based data injection
- DEBUG_FORCE_TRANSIENT_VIEW_OVERRIDE setting with base/development config
- Single-line integration in StatusView for transient view overrides
- Management command for external data injection and control
Usage: python manage.py dev_inject transient_view '{"url":"/test"}'
Options: --persistent, --cache, --list, --clear
* Phase 1: Create hi.testing Django app and migrate dev injection system
- Create proper hi.testing Django app structure with apps.py
- Copy all files from hi/tests to hi/testing (parallel structure)
- Add hi.testing to INSTALLED_APPS in development.py (alongside hi.tests)
- Move dev_inject management command from config to testing app
- Update dev injection imports in api/views.py to use hi.testing
- Verify system works: command available, imports successful
Both hi.tests and hi.testing coexist safely during transition.
Dev injection system now in semantically correct location.
* Complete migration from hi.tests to hi.testing Django app
Phase 2 & 3: Mass import migration and cleanup
- Update 105+ files to import from hi.testing instead of hi.tests
- Remove hi.tests from INSTALLED_APPS in development.py
- Delete old hi/tests directory and all contents
- Fix internal imports within hi.testing module
- Clean up migration artifacts
Results:
- All imports now use proper hi.testing Django app
- Dev injection system fully functional in new location
- Clean codebase with proper semantic organization
- Development-only safety pattern maintained
* Document development data injection system in Testing.md
Add high-level overview of the dev injection system as a general-purpose
runtime behavior modification tool. Uses status response injection as
concrete example while positioning it as extensible mechanism for any
injection point. References detailed docs in DevInjectionManager.
* Fix flake8 linting violations in testing module
* Fix sensor ID type consistency and video stream URL logic
- Change AlarmSourceDetails.sensor_id from str to int for type consistency
- Fix ViewUrlUtils to use video stream sensor ID instead of source sensor ID
- Update tests to use proper sensor ID types and expected video stream URLs
- Fix unit test data setup with proper entity/sensor relationships
* Fix URL bar not reverting when auto-view switches back to original view
- Track original URL when entering transient view
- Use history.back() to properly pop transient URL from browser history stack
- Add fallback using replaceState() if history navigation fails
- Ensure URL bar matches displayed content after auto-view revert
* Fix URL management for multiple consecutive transient views
- Track all transient URLs in array as they are pushed by antinode.js
- Pop all tracked URLs with comprehensive sanity checking when reverting
- Handle race conditions by validating current URL matches expected before each pop
- Enforce invariant that original URL is restored using replaceState fallback
- Prevent history corruption when antinode.js fails or timing issues occur
* Refactor auto-view.js for better maintainability
- Add resetTransientState() helper to consolidate state cleanup
- Extract popTransientUrlIfMatches() to reduce code duplication
- Simplify revertToOriginalView() and makeTransientViewPermanent()
- Add section organization comments for better readability
- Reduce complexity in restoreOriginalUrl() method
* Improve auto-view transient indicator to be layout-friendly
Replace top banner with constrained visual indicator:
- Border effect around main content area during transient views
- Corner badge with reason and pulse animation
- Indicator constrained to main panel, no content occlusion
- Responsive design for mobile devices
* Fix corner badge visibility and use warning colors
- Use portal approach: append badge to body with calculated positioning
- Safer implementation that doesn't modify main content area styling
- Change colors from primary to warning for alert-like appearance
- Add dynamic repositioning on window resize
- Preserve SVG layout responsiveness
* Improve auto-view indicator design per feedback
- Remove pulse animation for cleaner, less distracting indicator
- Change from rounded to rectangular badge design
- Move badge to bottom-right corner, flush to main content boundary
- Dynamic width sizing: auto-width up to max-width of main content
- Short text = minimal occlusion, long text = bottom banner equivalent
* Refatored recently added new "testing" module.
* Updated testing doc for new testing URL location.
---------
Co-authored-by: Tony Cassandra <github@cassandra.org>
Co-authored-by: Claude <noreply@anthropic.com>
Added Implementation Approach section explaining how synthetic visual states
(recent/past) are created from sensor history for better user context.
Documented color progression and supported state types without implementation
details to avoid maintenance burden.
* Enhance alert details dialog with improved styling and prominent visual content display
- Add card-based layout with proper information hierarchy
- Implement alert summary header with key metadata
- Add prominent visual content section for images/video streams
- Search ALL alarms for visual content, not just latest
- Add collapsible section for additional alarms
- Improve responsive design and accessibility
- Follow existing Bootstrap patterns and CSS variables
* Apply Django best practices: move business logic from template to view
- Add Django template guidelines to CLAUDE.md documentation
- Move complex loop logic from template to AlertDetailsView._get_first_visual_content()
- Simplify template to use pre-processed alert_visual_content data
- Fix invalid Django template syntax ({% break %} tags)
- Follow principle of minimal business logic in templates
* Add UI testing framework for alert module
- Create alert/tests/ui/urls.py with alert details test routes
- Implement TestUiAlertDetailsView with synthetic data scenarios
- Add alert/tests/ui/home.html template with test links
- Support testing various alert types: single/multiple alarms, with/without images
- Enable testing of enhanced alert details dialog from Issue #84
* Add missing __init__.py for alert UI testing package
Enables auto-discovery by main UI testing framework at /tests/ui/
* Fix alert UI testing URL patterns
Remove redundant 'alert/' prefix from details URL pattern.
URLs should be:
- /tests/ui/alert/ (home)
- /tests/ui/alert/details/<type> (alert details)
* Fix SecurityLevel enum values in alert UI testing
Replace SecurityLevel.NORMAL with SecurityLevel.LOW to match
actual enum values (HIGH, LOW, OFF)
* Fix AlertManager access in UI testing views
Use correct _alert_queue._alert_list to store synthetic alerts
instead of non-existent _alerts attribute
* Refactor AlertSyntheticData to support non-random, specific alerts
- Add create_single_alarm_alert() for single alarm scenarios
- Add create_multiple_alarm_alert() for multi-alarm scenarios
- Add create_event_based_alert() for entity state change alerts
- Add create_weather_alert() for weather-based alerts
- Refactor UI testing views to use centralized AlertSyntheticData
- Follow project design principle of centralizing test data creation
- Remove duplicate alarm/alert creation code from UI testing views
- Maintain backward compatibility with existing random alert generation
* Fix UI testing framework to prevent system state modification (Issue #84)
* Refactor: Move get_first_visual_content to Alert class to eliminate duplication
* Add comprehensive unit tests for Alert.get_first_visual_content() method
* Document UI testing framework guidelines for system state isolation
* Reorganize CLAUDE.md workflow for better process adherence and add design-heavy issue guidance
Add Complex Issue Implementation Strategy section to Guidelines.md with core methodology, key principles, and Issue #30 case study. Add step 3.5 to CLAUDE.md workflow for applying multi-phase approach when tackling complex issues with multiple aspects or trade-offs.
- Enhanced CLAUDE.md with development environment checks
- Improved AiAgentSetup.md with latest procedures
- Updated Setup.md with additional configuration details
These documentation updates improve guidance for AI-assisted development workflows.
* Improve workflow documentation to include staging branch sync step
* Fix controller dialog action to stay in modal context
- Add data-stay-in-modal attribute to controller forms in modal context
- Modify antinode.js to skip modal dismissal when data-stay-in-modal is present
- Update ControllerView to detect modal context via response_context parameter
- Pass in_modal_context to controller templates when rendered in entity dialogs
- Preserves existing behavior for non-modal controller usage
Fixes#31
* Improve workflow documentation to include mandatory environment setup
- Add environment initialization as step 4 in main workflow
- Update Testing Workflow to include init-env-dev.sh setup step
- Fix command paths to consistently use 'cd src &&' prefix
- Correct flake8 target path from 'src/' to 'hi/' throughout
- Ensure all testing commands reference proper working directory
This addresses the gap where workflow step 9 (testing) would fail
without proper environment initialization from step 4.
* Make init-env-dev.sh idempotent to prevent shell prompt nesting
- Add check for VIRTUAL_ENV before sourcing venv/bin/activate
- Prevents annoying prompt nesting like (venv) (venv) $ when run multiple times
- Improves performance by avoiding unnecessary re-activation
- Makes script truly safe to run multiple times in workflow
- Maintains all existing functionality while improving developer UX
* Add branch naming conventions directly to CLAUDE.md workflow
- Include the most common branch naming patterns in step 5
- Use bugfix/31-controller-modal-fix as example (showing correct naming)
- Prevents need to context-switch to docs/dev/Workflow.md
- Still references full conventions in Workflow.md for completeness
- Makes it clear that current branch should have been bugfix/31-*
* Improve init-env-dev.sh with error checking and user feedback
- Add existence check for venv/bin/activate with helpful error message
- Add existence check for .private/env/development.sh with creation guidance
- Show success messages for virtual environment activation and env vars
- Display informative message when venv already active with deactivate hint
- Use clear visual indicators (✓ and ERROR:) for better UX
- Script now exits with error code when prerequisites are missing
- Eliminates silent failures and provides actionable guidance
* Address PR review feedback and add boolean coding convention
- Refactor ControllerView.post() to eliminate code duplication per reviewer suggestion
- Use single call to controller_data_response() with computed in_modal_context parameter
- Add bool() coding convention to Development Guidelines for explicit boolean intent
- Apply bool() wrapper to response_context comparison for consistency
This makes the logic more readable and explicit while following project conventions.
* Clean up unused imports in control views
Remove unused typing.List, HttpRequest, and HttpResponse imports
that became unnecessary after refactoring the controller_data_response calls.
All mandatory testing checks now pass:
- ✅ Unit tests: 1475 tests passed
- ✅ Code quality: flake8 clean
- ✅ Django check: no issues
* Standardize CLAUDE.md workflow commands to use project root directory
- Replace all 'cd src &&' patterns with src/ prefixes
- Update Testing Workflow commands to run from consistent directory
- Update Pull Request Requirements command examples
- Update Development Commands Quick Reference
- Update Generated Code Standards compliance check
- Add explicit note about PROJECT ROOT consistency
This eliminates directory confusion and failed commands from wrong working directory.
All Django and flake8 commands now use src/ prefix for clear, consistent execution.
* Add comprehensive post-PR cleanup workflow with safety checks
- Add step 10 for post-merge cleanup and preparation for next work
- Include mandatory safety verification before any destructive actions:
* Verify current branch is feature branch (not staging/master)
* Verify clean working directory (no uncommitted changes)
* Verify PR is actually merged via gh CLI
- Add cleanup actions: switch to staging, sync, delete branch, verify state
- Include explicit STOP conditions and failure handling
- Reference cleanup workflow from step 2 for proper sequencing
- Emphasize human-initiated process to prevent accidental execution
Prevents catastrophic mistakes like deleting wrong branches or losing work.
* Added Django view tests across all modules.
* Refactoring to remove overly mocked view tests. Round 1.
* Refactoing to remove mocking in view tests. Round 2
* Refacoring to removing mocking in Django view tests. Round 3 (final)
* Refactor async test infrastructure to eliminate code duplication
- Create AsyncTaskTestCase base class for tests using asyncio event loops
- Consolidate duplicated setUpClass/tearDownClass/run_async methods
- Update 7 async test classes to inherit from new base class
- Add utilities for tracking and cleaning up background event loops
- Maintain separation between async task testing and AJAX request testing
This refactoring improves maintainability and provides a foundation
for addressing test suite hanging issues.
* Fix test suite hanging and resolve all linting issues
- Add cleanup() method to SecurityManager to cancel timer threads
- Call cleanup in test tearDown to prevent test hanging
- Remove unused imports from multiple test files
- Fix extra blank lines in event edit tests
- Add missing newline at end of async_task_utils.py
The hanging occurred because SecurityManager creates Timer threads for
delayed security state transitions, and these non-daemon threads were
not being cancelled when tests completed. Issue was introduced when
SecurityManager mocking was removed in recent refactoring.
All linting issues resolved per .flake8-ci configuration.
* Improvements to the weather module unit tests.
* Improved unit tests for the control module.
* Improved unit tests for collection module.
* Unit test improvements for alert module.
* Improved unit tests for entity module.
* Improved unit tests fr config module.
* Improved unit tests for audio module.
* Improved unit tests for location module.
* Improved unit tests for event module.
* Fixed some unit tests linting errors.
* Improved unit tsts for console.
* Improved unit tests for sense module.
* Improved existing unit tests for montor module.
* Added unit tests for monitor module. Found bug. Fixed it.
* Improved unit tests for notify module.
* Improved unit tests for security module.
* Improved unit tests for user module.
* Add comprehensive unit tests for HASS and ZoneMinder integration services
- Create complete test suite for ZoneMinder services (manager, controller, sync)
- Add comprehensive HASS service tests (manager, client, controller, sync)
- Include real API response data for enhanced test robustness
- Cover database operations, external API boundaries, and error handling
- Address zero test coverage gaps identified in Issue #52
* A boatload of integration/service unit test adds and fixes.
* Addressed PR feedback about empty IntegrationKey instances.
- Move architecture overview from CLAUDE.md to dev/Architecture.md
- Enhance dev/Guidelines.md with coding standards and flake8 configurations
- Add comprehensive testing guidelines to dev/Testing.md
- Expand dev/Setup.md with daily development commands
- Streamline CLAUDE.md to focus on environment-specific config
- Add cross-references between documentation files
- Separate Claude-specific guidance from universal project guidelines
Closes#54
- Fix typo 'organizes' to 'organize' in README.md
- Fix typo 'Un'zip' to 'unzip' in README.md and Installation.md
- Fix typo 'functonality' to 'functionality' in CONTRIBUTING.md
- Fix typo 'envirnoment' to 'environment' in Setup.md
- Improve Redis startup instruction clarity in Setup.md
- Fix multiple typos in GettingStarted.md including 'thne', 'LIne', 'integations', 'acquaintences'
- Fix typos 'trhe', 'UURLs', 'triued' in Guidelines.md
* Fix trackpad click detection on SVG elements (Issue #46)
- Add synthetic click event generation for MacBook trackpads on SVG elements
- Fix handlePointerCancelEvent missing event parameter
- Add memory leak prevention for gLastMoveEventTimes cleanup
- Add null safety checks for pointer event handlers
- Reset potential click state during multi-touch transitions
* Update CLAUDE.md with correct remote repository name
- Document that remote is named 'github' not 'origin'
- Add git push guidance for future reference
* Document GitHub pull request template in CLAUDE.md
- Add reference to .github/PULL_REQUEST_TEMPLATE.md
- Note that template auto-populates with gh pr create
* Added initial scaffolding for weather support.
* Code cleanup and refactor around SecurityManager accesses.
* Added initial pass for an internal, unified weather data model.
* Added display unit conversions and UI testing page for weather app.
* Added template scaffolding and initial data model for weather.
* Finished templates and test data scaffolding for weather views.
* Added user setting for geo location (lat/long).
* WIP for weather monitors and NWS API integration.
* Beter factoring and parsing for NWS weather data source.
* Added WMO units and unit test for it. WIP for NWS weather source.
* Added unit tests for weather app (transient) models.
* Added unit test for NWS weather source observation parsing.
* Renamed a bunch of mixin file names for pluralization consistency.
* Straggler (missed) mixin file name change from previous commit.
* Added folding in of updated weath data into WeatherManager.
* Fixed some bug around fetching NWS data for the first time.
* Added WeatherStation to data model. WIP
* Finished adding new WeatherStation to weather data model.
* Added weather stations to UI.
* Added fetching NWS forecast data (hourly and 12 hour).
* Added three-valued parsing for NWS data: min, ave, max
* Updated weather synthetic data for recent model tweaks.
* Some variable/class renaming. Prep for forecast data model changes.
* Added StatisticDataPoint for min/max/ave values.
* Some minor refactoring to improve class naming and structures.
* Saving WIP for weather data aggregation class and data structures.
* Added improvement to dev docs.
* From strudel...more weather work.
* Removed redundant "elevation" model fields.
* Completed initial weather integrations w/Claude Code.
* Implement auto-discovery weather source configuration system
* Fix weather module unit test failures and improve WMO units handling
* Add git commit message guidelines to CLAUDE.md
* Expand testing infrastructure documentation with comprehensive high-value testing patterns and system architecture insights
* Fixed a few weather app bugs.
* Weather data inspection script and weather app bug fixes.
* More weather bug fixes and unit tests.
* More testing and fixing of initial weather app.
* Added sunrise-sunset.org integration. Fixed boolean config bug.
* Fixed astronomical data integration.
* Added future astronomical data frim sunrise-sunset.org API.
* Added USNO API data for sun and moon.
* Added weather alert data from NWS. Still need to map to Alarms.
* Added mapping weather alerts to system Alarms.
* Added tracking min/max daily temperatures.
* Tweaks and refinements for weather alerts.
* Last weather app tweaks before declaring first version done.
* Moved console context processor to more logical location.
* Fixed and updates some unit tests.
* Coding style fixes for weather module.
* Updated dev workflow doc.
* Fixed a bunch of code formatting.
* A few more code style fixes.
* Added missing import.
* Added docker restart flag and updated docs.
* Capturing lingering release process doc updates from last release.
* Improved the GitHub pull request template.