def __init__(self, service_id): UPnPService.__init__(self, service_id, 'URLService', service_version=1) # Define Evented Variable self._url = self.define_evented_variable("URL", types.StringType, DEFAULT_URL) # Define Actions self.define_action(self.get_url, out_args=[("URL", types.StringType)], name="GetURL") self.define_action(self.set_url, in_args=[("URL", types.StringType)], name="SetURL")
def __init__(self, service_id=None, service_version=1): if service_id == None: service_id = _DEFAULT_SERVICE_ID UPnPService.__init__(self, service_id, service_version) self._bookmarks = [] # Define Event Variable self._update_event = self.define_evented_variable("UPDATE", types.BooleanType, False) # Define Actions self.define_action(self.get, out_args=[("BOOKMARKS", types.StringType)], name="GET") self.define_action(self.post, in_args=[("BOOKMARK", types.StringType)], name="POST")
def __init__(self, service_id): UPnPService.__init__(self, service_id, 'SwitchPower', service_version=1) boolean = types.BooleanType # Define EventVariables self._status = self.define_evented_variable("Status", boolean, False) # Define Actions self.define_action(self.get_status, out_args=[("ResultStatus", boolean )], name="GetStatus") self.define_action(self.get_target, out_args=[("RetTargetValue", boolean)], name="GetTarget") self.define_action(self.set_target, in_args=[("NewTargetValue", boolean)], name="SetTarget") # Service State self._target = False