fix get_actor_state () in CBPiBase

This commit is contained in:
avollkopf 2022-01-31 07:27:01 +01:00
parent f2e9b1bebc
commit a7ddcdd306
2 changed files with 4 additions and 4 deletions

View file

@ -1 +1 @@
__version__ = "4.0.1.7" __version__ = "4.0.1.8"

View file

@ -51,10 +51,10 @@ class CBPiBase(metaclass=ABCMeta):
def get_actor_state(self,id): def get_actor_state(self,id):
try: try:
actor = self.cbpi.actor.find_by_id(id) actor = self.cbpi.actor.find_by_id(id)
return actor.get("instance").get_state() return actor.instance.state
except: except:
logging.error("Failed to read actor state in step - actor {}".format(id)) logging.error("Failed to read actor state in step - actor {}".format(id))
return None return False
async def actor_on(self,id,power=100): async def actor_on(self,id,power=100):
@ -73,4 +73,4 @@ class CBPiBase(metaclass=ABCMeta):
try: try:
await self.cbpi.actor.set_power(id,power) await self.cbpi.actor.set_power(id,power)
except Exception as e: except Exception as e:
pass pass