fix erroneous call to self.vm

logging level INFO added
This commit is contained in:
onyx-and-iris 2022-09-28 18:14:06 +01:00
parent 23bc15e437
commit 5177c2d297

View File

@ -1,3 +1,5 @@
import logging
import vban_cmd import vban_cmd
@ -7,7 +9,7 @@ class Observer:
# register your app as event observer # register your app as event observer
self.vban.subject.add(self) self.vban.subject.add(self)
# add level updates, since they are disabled by default. # add level updates, since they are disabled by default.
self.vm.event.add("ldirty") self.vban.event.add("ldirty")
# define an 'on_update' callback function to receive event updates # define an 'on_update' callback function to receive event updates
def on_update(self, subject): def on_update(self, subject):
@ -29,7 +31,7 @@ class Observer:
def main(): def main():
with vban_cmd.api(kind_id, **opts) as vban: with vban_cmd.api(kind_id, **opts) as vban:
obs = Observer(vban) Observer(vban)
while cmd := input("Press <Enter> to exit\n"): while cmd := input("Press <Enter> to exit\n"):
if not cmd: if not cmd:
@ -37,6 +39,8 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
kind_id = "potato" kind_id = "potato"
opts = { opts = {
"ip": "<ip address>", "ip": "<ip address>",