Skip to content

documentation update#34

Merged
eman merged 11 commits intomainfrom
appanalysis
Nov 7, 2025
Merged

documentation update#34
eman merged 11 commits intomainfrom
appanalysis

Conversation

@eman
Copy link
Copy Markdown
Owner

@eman eman commented Nov 5, 2025

No description provided.

eman added 4 commits November 5, 2025 10:57
- Handle AWS_ERROR_MQTT_CONNECTION_DESTROYED in mqtt_connection.py publish()
  - Marks connection as disconnected to trigger reconnection handler
  - Logs warning with context about AWS-initiated disconnections
  - Allows reconnection handler to recover automatically

- Improve error classification in mqtt_periodic.py
  - Distinguish between CANCELLED_FOR_CLEAN_SESSION (debug) and CONNECTION_DESTROYED (warning)
  - Prevents 'Future exception was never retrieved' errors
  - Continues periodic requests despite connection destruction

Fixes periodic timeouts (~24h) when AWS IoT Core disconnects clients
after their timeout limit. Ensures seamless recovery without manual
intervention required in Home Assistant.
eman added 3 commits November 6, 2025 17:42
- Simplify multi-line condition in mqtt_periodic.py to single line
- Format examples and other files per ruff format standards

All code now passes ruff linting and formatting checks.
@eman eman requested a review from Copilot November 7, 2025 01:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates emoji and special character indicators throughout the codebase to use plain text alternatives (e.g., [SUCCESS], [ERROR]). This improves compatibility across different terminal environments and CI systems that may not properly render Unicode emoji characters.

Key Changes

  • Replaced all emoji indicators with bracket-wrapped text equivalents throughout examples, scripts, and documentation
  • Updated error handling messages in MQTT connection code to handle AWS_ERROR_MQTT_CONNECTION_DESTROYED events
  • Changed User-Agent string from NaviLink-Python/1.0.0 to nwp500-python/1.0.0 for consistency with package naming
  • Added comprehensive new documentation files for data conversions, scheduling features, and advanced features

Reviewed Changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/nwp500/mqtt_periodic.py Enhanced error handling for MQTT connection destruction with improved logging
src/nwp500/mqtt_connection.py Added specific handling for AWS connection destruction during publish operations
src/nwp500/auth.py Updated User-Agent header to match package name
scripts/*.py Replaced emoji indicators with plain text alternatives for better terminal compatibility
examples/*.py Replaced emoji indicators with plain text alternatives throughout all example files
docs/*.rst Replaced emoji/special characters with plain text and added new comprehensive documentation

eman and others added 4 commits November 6, 2025 17:59
- Import __version__ from package instead of hardcoding
- User-Agent now reflects actual package version via setuptools_scm
- Follows project version management guidelines (no hardcoded versions)

This ensures the User-Agent header always uses the correct version
from setuptools_scm without manual updates.
- Extract error_name once using conditional expression and getattr()
- Eliminate nested if statements for cleaner control flow
- Remove duplicate error logging (RuntimeError path)
- Use elif chain instead of nested if/elif
- Improves readability and reduces code nesting

The logic remains identical but is now more maintainable.
- Remove redundant 'ERROR:' prefix from error messages
- Replace with ❌ emoji for consistency
- Apply ruff formatting fixes (whitespace, line length)
- Remove unnecessary f-string prefix (no placeholders)

Error messages now have consistent formatting without duplication.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@eman eman merged commit fc1455c into main Nov 7, 2025
10 checks passed
@eman eman deleted the appanalysis branch November 7, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants