mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-25 00:18:17 +01:00
actor methods added
This commit is contained in:
parent
4fe47d5a31
commit
fbccd11c9e
1 changed files with 13 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
from abc import ABCMeta
|
||||
import asyncio
|
||||
from cbpi.api.extension import CBPiExtension
|
||||
from cbpi.api.config import ConfigType
|
||||
|
||||
__all__ = ["CBPiActor"]
|
||||
|
||||
|
@ -40,6 +41,18 @@ class CBPiActor(metaclass=ABCMeta):
|
|||
async def stop(self):
|
||||
self.running = False
|
||||
|
||||
def get_static_config_value(self,name,default):
|
||||
return self.cbpi.static_config.get(name, default)
|
||||
|
||||
def get_config_value(self,name,default):
|
||||
return self.cbpi.config.get(name, default=default)
|
||||
|
||||
async def set_config_value(self,name,value):
|
||||
return await self.cbpi.config.set(name,value)
|
||||
|
||||
async def add_config_value(self, name, value, type: ConfigType, description, options=None):
|
||||
await self.cbpi.add(name, value, type, description, options=None)
|
||||
|
||||
async def on(self, power):
|
||||
'''
|
||||
Code to switch the actor on. Power is provided as integer value
|
||||
|
|
Loading…
Reference in a new issue