Error in python code
<p>Please see the code and the error in the last.</p>

<pre><code>from brisa.core.reactors import install_default_reactor
reactor = install_default_reactor()
print reactor

import os

from brisa.upnp.device import Device, Service
from brisa.upnp.device.service import StateVariable


class BinaryLight(Device):

    def __init__(self):
        Device.__init__(self,
                        'urn:schemas-upnp-org:device:BinaryLight:1',
                        'Binary Light device')


class SwitchPower(Service):

    def __init__(self):
        Service.__init__(self,
                         'SwitchPower',
                         'urn:schemas-upnp-org:service:SwitchPower:1',
                         '',
                         os.getcwd() + '/SwitchPower-scpd.xml')
        self.target = False
        self.status = False
        self.varin = StateVariable(self, "Status",
                              True, False, "boolean")
        self.varin.subscribe_for_update(self.varUpdateCallback)
        self.add_state_variable(self.varin)

    def varUpdateCallback(self, name, value):
        print name, 'was updated to', value

    def SetTarget(self, *args, **kwargs):
        self.target = kwargs['NewTargetValue']
        self.status = self.target
        self.set_state_variable('Status', self.target)
        print 'Light switched ', {'1': 'on', '0': 'off'}.get(self.target, None)
        return {}

    def GetTarget(self, *args, **kwargs):
        return {'RetTargetValue': self.target}

    def soap_GetStatus(self, *args, **kwargs):
        return {'ResultStatus': self.status}


if __name__ == '__main__':
    device = BinaryLight()
    device += SwitchPower()

    # Start device
    device.start()

    # Setup main loop
    reactor.add_after_stop_func(device.stop)
    reactor.main()
</code></pre>

<p>I am getting an error:-</p>

<p>ankit@ubuntu:~/Desktop$ python binary_light.py Could you please tell me where I am doing mistake?? </p>

<pre><code>Error:
Traceback (most recent call last):
  File "binary_light.py", line 8, in &lt;module&gt;
    from brisa.upnp.device import Device, Service
  File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/device/__init__.py", line 8, in &lt;module&gt;
    from brisa.upnp.device.device import Device
  File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/device/device.py", line 10, in &lt;module&gt;
    from brisa.core import log, config, webserver, network
  File "/usr/local/lib/python2.6/dist-packages/brisa/core/webserver.py", line 39, in &lt;module&gt;
    raise RuntimeError('Network is down.')
RuntimeError: Network is down.
</code></pre>

<p>NEW ERROR:</p>

<pre><code>Traceback (most recent call last):
  File "binary_light.py", line 57, in &lt;module&gt;
    device = BinaryLight()
  File "binary_light.py", line 21, in __init__
    'Binary Light device')
  File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/device/device.py", line 83, in __init__
    additional_headers=additional_ssdp_headers)
  File "/usr/local/lib/python2.6/dist-packages/brisa/upnp/ssdp.py", line 71, in __init__
    data_callback=self._datagram_received)
  File "/usr/local/lib/python2.6/dist-packages/brisa/core/network_listeners.py", line 188, in __init__
    self._create_socket(shared_socket)
  File "/usr/local/lib/python2.6/dist-packages/brisa/core/network_listeners.py", line 227, in _create_socket
    "Couldn't bind address")
brisa.core.network_listeners.CannotListenError
</code></pre>

<p>please let me know where I am doing mistake??</p>
