Rename profiles to automations across backend and frontend
Rename the "profiles" entity to "automations" throughout the entire codebase for clarity. Updates Python models, storage, API routes/schemas, engine, frontend JS modules, HTML templates, CSS classes, i18n keys (en/ru/zh), dashboard, tutorials, and command palette. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ class MQTTService:
|
||||
Features:
|
||||
- Publish messages (retained or transient)
|
||||
- Subscribe to topics with callback dispatch
|
||||
- Topic value cache for synchronous reads (profile condition evaluation)
|
||||
- Topic value cache for synchronous reads (automation condition evaluation)
|
||||
- Auto-reconnect loop
|
||||
- Birth / will messages for online status
|
||||
"""
|
||||
@@ -95,7 +95,7 @@ class MQTTService:
|
||||
logger.warning(f"MQTT subscribe failed ({topic}): {e}")
|
||||
|
||||
def get_last_value(self, topic: str) -> Optional[str]:
|
||||
"""Get cached last value for a topic (synchronous — for profile evaluation)."""
|
||||
"""Get cached last value for a topic (synchronous — for automation evaluation)."""
|
||||
return self._topic_cache.get(topic)
|
||||
|
||||
async def _connection_loop(self) -> None:
|
||||
@@ -170,7 +170,7 @@ class MQTTService:
|
||||
topic = f"{self._config.base_topic}/target/{target_id}/state"
|
||||
await self.publish(topic, json.dumps(state), retain=True)
|
||||
|
||||
async def publish_profile_state(self, profile_id: str, action: str) -> None:
|
||||
"""Publish profile state change to MQTT."""
|
||||
topic = f"{self._config.base_topic}/profile/{profile_id}/state"
|
||||
async def publish_automation_state(self, automation_id: str, action: str) -> None:
|
||||
"""Publish automation state change to MQTT."""
|
||||
topic = f"{self._config.base_topic}/automation/{automation_id}/state"
|
||||
await self.publish(topic, json.dumps({"action": action}), retain=True)
|
||||
|
||||
Reference in New Issue
Block a user