diff --git a/xair_api/bus.py b/xair_api/bus.py index 1df3ace..cd8538f 100644 --- a/xair_api/bus.py +++ b/xair_api/bus.py @@ -13,8 +13,7 @@ class IBus(abc.ABC): self.index = index + 1 def getter(self, param: str): - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/config.py b/xair_api/config.py index 9dc8d0b..98aaac2 100644 --- a/xair_api/config.py +++ b/xair_api/config.py @@ -13,8 +13,7 @@ class IConfig(abc.ABC): self._remote = remote def getter(self, param: str): - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/dca.py b/xair_api/dca.py index e7ed5b7..95d7074 100644 --- a/xair_api/dca.py +++ b/xair_api/dca.py @@ -11,8 +11,7 @@ class IDCA(abc.ABC): self.index = index + 1 def getter(self, param: str) -> tuple: - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/fx.py b/xair_api/fx.py index c8450af..d597657 100644 --- a/xair_api/fx.py +++ b/xair_api/fx.py @@ -13,8 +13,7 @@ class IFX(abc.ABC): self.index = index + 1 def getter(self, param: str): - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/lr.py b/xair_api/lr.py index 85236b4..8821779 100644 --- a/xair_api/lr.py +++ b/xair_api/lr.py @@ -15,8 +15,7 @@ class ILR(abc.ABC): self.index = index + 1 def getter(self, param: str): - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/rtn.py b/xair_api/rtn.py index 47a3c88..f9171ed 100644 --- a/xair_api/rtn.py +++ b/xair_api/rtn.py @@ -15,8 +15,7 @@ class IRtn(abc.ABC): self.index = index + 1 def getter(self, param: str): - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/strip.py b/xair_api/strip.py index 19800cf..448dcb7 100644 --- a/xair_api/strip.py +++ b/xair_api/strip.py @@ -13,8 +13,7 @@ class IStrip(abc.ABC): self.index = index + 1 def getter(self, param: str) -> tuple: - self._remote.send(f"{self.address}/{param}") - return self._remote.info_response + return self._remote.query(f"{self.address}/{param}") def setter(self, param: str, val: int): self._remote.send(f"{self.address}/{param}", val) diff --git a/xair_api/xair.py b/xair_api/xair.py index 8d3d7c5..485ec54 100644 --- a/xair_api/xair.py +++ b/xair_api/xair.py @@ -98,10 +98,10 @@ class XAirRemote(abc.ABC): def send(self, addr: str, param: Optional[str] = None): self.logger.debug(f"sending: {addr} {param if param is not None else ''}") self.server.send_message(addr, param) - time.sleep(self._delay) def query(self, address): self.send(address) + time.sleep(self._delay) return self.info_response def __exit__(self, exc_type, exc_value, exc_tr):