Loading ccserver/clients/hv.py +9 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ import threading from ccserver.handlers import listed from ccserver.clients import Client, RegisteredCCHandler from ccserver.db import RemoteTag from cloudcontrol.common.tql.db.object import TqlObject from cloudcontrol.common.tql.db.tag import StaticTag, CallbackTag Loading Loading @@ -153,8 +154,8 @@ class HvClient(Client): :param value: value of the tag """ callback = partial(self.get_child_remote_tags, obj_id, name) tag = CallbackTag(name, callback, ttl=ttl) callback = partial(self.async_remote_sub_tags, obj_id) tag = RemoteTag(name, callback, ttl=ttl) self._children[obj_id].register(tag) def sub_tags_unregister(self, obj_id, name): Loading Loading @@ -192,5 +193,11 @@ class HvClient(Client): if ttl is not None: tag.ttl = ttl def async_remote_sub_tags(self, obj_id, watcher, robj, tags): """ Asynchronously update sub tags from the remote client using specified watcher. """ watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=robj) Client.register_client_class(HvClient) Loading
ccserver/clients/hv.py +9 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ import threading from ccserver.handlers import listed from ccserver.clients import Client, RegisteredCCHandler from ccserver.db import RemoteTag from cloudcontrol.common.tql.db.object import TqlObject from cloudcontrol.common.tql.db.tag import StaticTag, CallbackTag Loading Loading @@ -153,8 +154,8 @@ class HvClient(Client): :param value: value of the tag """ callback = partial(self.get_child_remote_tags, obj_id, name) tag = CallbackTag(name, callback, ttl=ttl) callback = partial(self.async_remote_sub_tags, obj_id) tag = RemoteTag(name, callback, ttl=ttl) self._children[obj_id].register(tag) def sub_tags_unregister(self, obj_id, name): Loading Loading @@ -192,5 +193,11 @@ class HvClient(Client): if ttl is not None: tag.ttl = ttl def async_remote_sub_tags(self, obj_id, watcher, robj, tags): """ Asynchronously update sub tags from the remote client using specified watcher. """ watcher.register(self.conn, 'sub_tags', obj_id, tags, _data=robj) Client.register_client_class(HvClient)