Package brisa :: Package upnp :: Module base_service :: Class BaseStateVariable
[hide private]
[frames] | no frames]

Class BaseStateVariable

source code

object --+
         |
        BaseStateVariable

Represents a service state variable.

Instance Methods [hide private]
 
__init__(self, service, name, send_events, multicast, data_type, values)
Constructor for the StateVariable class.
source code
 
get_value(self)
Returns the value of the variable.
source code
 
update(self, value)
Updates the state variable value.
source code
 
subscribe_for_update(self, callback)
Subscribes the callback for variable update event.
source code
 
unsubscribe_for_update(self, callback)
Unsubscribes the callback for variable update event.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, service, name, send_events, multicast, data_type, values)
(Constructor)

source code 

Constructor for the StateVariable class.

Parameters:
  • service (Service) - Service which holds this variable
  • name (string) - variable name
  • send_events (boolean) - send events option
  • multicast (boolean) - multicast option
  • data_type (string) - data type
  • values (string) - values
Overrides: object.__init__

update(self, value)

source code 

Updates the state variable value. The new value must has the same type as specified at data type.

Parameters:
  • value (data_type) - new value.

subscribe_for_update(self, callback)

source code 

Subscribes the callback for variable update event.

Parameters:
  • callback (callable) - callback which will listen on the event

unsubscribe_for_update(self, callback)

source code 

Unsubscribes the callback for variable update event.

Parameters:
  • callback (callable) - callback which listens for the event