diff --git a/nabclockd/tests/nabclockd_test.py b/nabclockd/tests/nabclockd_test.py index b28d42ab..3efd1fa0 100644 --- a/nabclockd/tests/nabclockd_test.py +++ b/nabclockd/tests/nabclockd_test.py @@ -103,7 +103,7 @@ def test_wakeup(self): self.assertEqual(len(self.wakeup_handler_packets), 2) # NLU packet self.assertTrue("type" in self.wakeup_handler_packets[0]) - self.assertEqual(self.wakeup_handler_packets[0]["type"], "idle") + self.assertEqual(self.wakeup_handler_packets[0]["type"], "mode") self.assertTrue("type" in self.wakeup_handler_packets[1]) self.assertEqual(self.wakeup_handler_packets[1]["type"], "wakeup") diff --git a/nabcommon/nabservice.py b/nabcommon/nabservice.py index 72e678a6..50c67b57 100644 --- a/nabcommon/nabservice.py +++ b/nabcommon/nabservice.py @@ -65,7 +65,9 @@ async def client_loop(self): try: service_dir = os.path.dirname(inspect.getfile(self.__class__)) if os.path.isdir(os.path.join(service_dir, "nlu")): - idle_packet = '{"type":"idle","events":["asr"]}\r\n' + idle_packet = ( + '{"type":"mode","mode":"idle","events":["asr"]}\r\n' + ) self.writer.write(idle_packet.encode("utf8")) while self.running and not self.reader.at_eof(): line = await self.reader.readline() @@ -443,7 +445,9 @@ async def perform(self, expiration_date, type, config): + "}\r\n" ) else: - info_packet = '{"type":"info","info_id":"' + service_name + '"}\r\n' + info_packet = ( + '{"type":"info","info_id":"' + service_name + '"}\r\n' + ) self.writer.write(info_packet.encode("utf8")) if type != "info": await self.perform_additional(