coherence.upnp.core.variable (module)

StateVariable

The StateVariable implements an UPnP variable with the ability to emmit changes via EventDispatcher whenever some class variable changes.

class StateVariable(upnp_service, name, implementation, instance, send_events, data_type, allowed_values)[source]

Bases: eventdispatcher.eventdispatcher.EventDispatcher, coherence.log.LogAble

Represents a UPnP variable. It has the ability to dispatch changes whenever some class variable changes.

    Changed in version 0.9.0:
  • Migrated from louie/dispatcher to EventDispatcher

  • Added two more class variables:

  • The emitted events changed:

    • Coherence.UPnP.StateVariable.changed => state_variable_changed

    • Coherence.UPnP.StateVariable.{var name}.changed => state_variable_{var name}_changed

logCategory = 'variable'
dispatch_events = []
dispatch_targets = []
as_tuples()[source]
set_default_value(value)[source]
set_allowed_values(values)[source]
set_allowed_value_range(**kwargs)[source]
get_allowed_values()[source]
set_never_evented(value)[source]
update(value)[source]
subscribe(callback)[source]
notify()[source]