def add_value(self, notification): item_id = "{0}:{1}".format(notification.network_id, notification.node_id) obj_value_id = notification.value_id value_type = Manager.get_value_type( obj_value_id ) value = Manager.get_value_as_string( obj_value_id ) last_changed = Manager.get_value_last_changed(obj_value_id) text="{0}={1} ({2})".format(value_type,value,last_changed) self.tree.insert(item_id,"end", obj_value_id.id, text=text)
def change_value(self, notification): obj_value_id = notification.value_id if self.tree.exists(obj_value_id.id): value_type = Manager.get_value_type( obj_value_id ) value = Manager.get_value_as_string( obj_value_id ) last_changed = Manager.get_value_last_changed(obj_value_id) text="{0}={1} ({2})".format(value_type,value,last_changed) self.tree.item(obj_value_id.id, text=text, tags=('updated')) self.root.after(10000, self.reset_foreground, obj_value_id.id)