mirror of
https://gitlab.com/fabinfra/fabaccess/fabfire_adapter.git
synced 2025-03-12 06:41:47 +01:00
update to newest api
This commit is contained in:
parent
8ab59e053f
commit
1a3f601881
15
reader.py
15
reader.py
@ -32,15 +32,24 @@ class Reader:
|
||||
self.timeout_timer.cancel()
|
||||
await client.publish(f"/cmnd/reader/{self.reader_id}", payload='{"Cmd":"haltPICC"}', qos=2,
|
||||
retain=False)
|
||||
info = await self.session.machineSystem.info().a_wait()
|
||||
ma = await info.info.getMachineURN(f"{self.machine_urn}").a_wait()
|
||||
|
||||
info = self.session.machineSystem.info
|
||||
ma = await info.getMachineURN(f"{self.machine_urn}").a_wait()
|
||||
|
||||
if ma.which() == "just":
|
||||
ma = ma.just
|
||||
else:
|
||||
logging.critical(f"Could not get machine {self.machine_urn}. Machine does not exist or insufficient permissions")
|
||||
raise Exception(f"Could not get machine {self.machine_urn}. Machine does not exist or insufficient permissions")
|
||||
|
||||
if ma.state == "inUse":
|
||||
await ma.inuse.giveBack().a_wait()
|
||||
await asyncio.sleep(2)
|
||||
await client.publish(f"/cmnd/reader/{self.reader_id}", payload='{"Cmd":"message","MssgID":0,"AddnTxt":""}', qos=2,
|
||||
retain=False)
|
||||
else:
|
||||
await ma.use.use().a_wait()
|
||||
await client.publish(f"/cmnd/reader/{self.reader_id}", payload=response_for_reader, qos=2,
|
||||
retain=False)
|
||||
await asyncio.sleep(2)
|
||||
await client.publish(f"/cmnd/reader/{self.reader_id}",
|
||||
payload='{"Cmd":"message","MssgID":3,"AddnTxt":""}', qos=2,
|
||||
|
2
schema
2
schema
@ -1 +1 @@
|
||||
Subproject commit c9283ebd696ed6dd428a7c3d24820889f7ab4bf3
|
||||
Subproject commit 19f20f5154f0eced6288ff56cac840025ee51da1
|
Loading…
x
Reference in New Issue
Block a user