mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-25 00:18:17 +01:00
fix get_actor_state () in CBPiBase
This commit is contained in:
parent
f2e9b1bebc
commit
a7ddcdd306
2 changed files with 4 additions and 4 deletions
|
@ -1 +1 @@
|
||||||
__version__ = "4.0.1.7"
|
__version__ = "4.0.1.8"
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue