Skip to content

Commit

Permalink
Merge branch 'master' into releng
Browse files Browse the repository at this point in the history
  • Loading branch information
pguyot committed Jan 22, 2020
2 parents a1c6243 + 89a385f commit d20ca54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nabclockd/tests/nabclockd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
8 changes: 6 additions & 2 deletions nabcommon/nabservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d20ca54

Please sign in to comment.