mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-04-27 03:15:19 +00:00
7bb51f219b
- Add Flask + Flask-SocketIO web viewer with dashboard (modules/web_viewer/app.py and related) - Add web viewer templates: index, realtime, tracking (contacts), cache, purging, stats (modules/web_viewer/templates/) - Add integration hooks and utility functions for web viewer (modules/web_viewer/integration.py, modules/utils.py) - Add command to launch web viewer from bot CLI (modules/commands/webviewer_command.py) - Update .gitignore: ignore db/log files, test scripts, and web viewer artifacts - Add restart_viewer.sh helper script for standalone web viewer restart/troubleshooting - Add guidance and documentation for modern viewer in WEB_VIEWER.md and docs/ - Various code structure and import improvements to core bot and command modules to support integration - Add ACL support for sensitive commands - Example config updates Benefits: - Decouples monitoring/UI from bot core process - Enables real-time browser dashboard and unified contact/repeater tracking - Easier integration, dev, and troubleshooting
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Sun Command - Provides sunrise/sunset information
|
|
"""
|
|
|
|
from .base_command import BaseCommand
|
|
from ..solar_conditions import get_sun
|
|
from ..models import MeshMessage
|
|
|
|
|
|
class SunCommand(BaseCommand):
|
|
"""Command to get sun information"""
|
|
|
|
def __init__(self, bot):
|
|
super().__init__(bot)
|
|
self.keywords = ['sun']
|
|
|
|
async def execute(self, message: MeshMessage) -> bool:
|
|
"""Execute the sun command"""
|
|
try:
|
|
# Get sun information using default location
|
|
sun_info = get_sun()
|
|
|
|
# Send response using unified method
|
|
response = f"☀️ Sun Info:\n{sun_info}"
|
|
return await self.send_response(message, response)
|
|
|
|
except Exception as e:
|
|
error_msg = f"Error getting sun info: {e}"
|
|
return await self.send_response(message, error_msg)
|
|
|
|
def get_help_text(self):
|
|
"""Get help text for this command"""
|
|
return "Get sunrise/sunset times and sun position"
|