My custom device do not appear

Hi,

I have developed a device with python using the guide of Webthings Framework. However, when I try to search for the device from the Gateway, it does not detect it and I do not know why.

I am leaving the code of the device here just in case help to find the problem:

from __future__ import division
from webthing import Action, Property, SingleThing, Thing, Value, WebThingServer
import logging
import uuid


class ChangeBrightnessAction(Action):
    def __init__(self, thing, input_):
        Action.__init__(self, uuid.uuid4().hex, thing, 'change_brightness', input_=input_)

    def perform_action(self):
        self.thing.set_property('brightness', self.input['brightness'])


def initialize_thing():
    thing = Thing(
        'urn:dev:ops:smart_lamp_7256',
        'SLamp',
        ['OnOffSwitch', 'Light'],
        'A smart lamp connected to the web'
    )

    thing.add_property(
        Property(thing, 'on', Value(True), metadata={
            '@type': 'SwitchProperty',
            'title': 'On/Off',
            'type': 'boolean',
            'description': 'Shows if the lamp is on',
        })
    )

    thing.add_property(
        Property(thing, 'brightness', Value(50), metadata={
            '@type': 'BrightnessProperty',
            'title': 'Brightness',
            'type': 'integer',
            'description': 'The light level from 0 to 100',
            'minimum': 0,
            'maximum': 100,
            'unit': 'percent',
        })
    )

    thing.add_available_action(
        'change_brightness', {
            'title': 'Change Brightness',
            'description': "Change the lamp brightness to a given level",
            'input': {
                'type': 'object',
                'required': [
                    'brightness',
                ],
                'properties': {
                    'brightness': {
                        'type': 'integer',
                        'minimum': 0,
                        'maximum': 100,
                        'unit': 'percent',
                    },
                },
            },
        },
        ChangeBrightnessAction)

    return thing


def run_server():
    thing = initialize_thing()
    server = WebThingServer(SingleThing(thing), port=8888)
    server.start()
    # I use another method to stop the server


def decoy():
    logging.basicConfig(
        level=10,
        format="%(asctime)s %(filename)s:%(lineno)s %(levelname)s %(message)s"
    )
    run_server()