korad_ka3005p: fix simulation mode

This commit is contained in:
Sebastien Bourdeauducq 2016-12-19 09:49:44 +01:00
parent 161025e7df
commit 68b2373b9a
1 changed files with 6 additions and 3 deletions

View File

@ -47,9 +47,12 @@ class KoradKA3005P:
return r
async def _ser_write(self, cmd):
logger.debug("_write %s: ", cmd)
await asyncio.sleep(0.1)
await self.port.write(cmd.encode('ascii'))
if self.simulation:
logger.info("simulation _ser_write(\"%s\")", cmd)
else:
logger.debug("_ser_write(\"%s\")", cmd)
await asyncio.sleep(0.1)
await self.port.write(cmd.encode("ascii"))
async def setup(self):
"""Configure in known state."""