module-v2-example: add an example module to show off the new capabilities
This commit is contained in:
parent
e12532338d
commit
3e80a6effb
|
@ -0,0 +1,16 @@
|
|||
class Counter:
|
||||
def __init__(self):
|
||||
self.counter = 0
|
||||
|
||||
def call_count(self):
|
||||
self.counter += 1
|
||||
return self.counter.et
|
||||
|
||||
c = Counter()
|
||||
|
||||
def get_num():
|
||||
return c.call_count()
|
||||
|
||||
def process(message, path):
|
||||
if message.text == "!v2-testing":
|
||||
return f"Testing successful - this is call number {get_num()}"
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"version": 2,
|
||||
"index_file": "index.py",
|
||||
"start_on_boot": true,
|
||||
"alias": "module-v2-example"
|
||||
}
|
Loading…
Reference in New Issue