Пример #1
0
    def to_started(self, from_state: str) -> None:
        """Transition to started state."""
        self.recorder = self.config["recorder"]
        self.mqtt = self.config["mqtt"]
        self.timeout_sec = self.profile.get("command.hermes.timeout_sec", 30)

        # Subscribe to MQTT topics
        self.site_ids = self.profile.get("mqtt.site_id", "default").split(",")
        self.send(self.mqtt, MqttSubscribe(self.start_topic))
        self.send(self.mqtt, MqttSubscribe(self.stop_topic))
Пример #2
0
 def to_started(self, from_state: str) -> None:
     """Transition to started state."""
     self.mqtt = self.config["mqtt"]
     self.site_ids = self.profile.get("mqtt.site_id", "default").split(",")
     if self.site_ids:
         self.site_id = self.site_ids[0]
     else:
         self.site_id = "default"
     self.topic_audio_frame = f"hermes/audioServer/{self.site_id}/audioFrame"
     self.send(self.mqtt, MqttSubscribe(self.topic_audio_frame))
Пример #3
0
    def to_started(self, from_state: str) -> None:
        """Transition to started state."""
        self.mqtt = self.config["mqtt"]

        # Subscribe to wake topic
        self.site_ids = self.profile.get("mqtt.site_id", "default").split(",")
        self.wakeword_id = self.profile.get("wake.hermes.wakeword_id", "default")
        self.wake_topic = f"hermes/hotword/{self.wakeword_id}/detected"
        self.send(self.mqtt, MqttSubscribe(self.wake_topic))

        self.transition("loaded")