def __init__(self, hass, conf):
    'Initialize the instance.'
    self.hass = hass
    self.type = conf.get(CONF_TYPE)
    self.numbers = None
    self.cached_states = {}
    if (self.type == TYPE_ALEXA):
        _LOGGER.warning('Emulated Hue running in legacy mode because type has been specified. More info at https://goo.gl/M6tgz8')
    self.host_ip_addr = conf.get(CONF_HOST_IP)
    if (self.host_ip_addr is None):
        self.host_ip_addr = util.get_local_ip()
        _LOGGER.info('Listen IP address not specified, auto-detected address is %s', self.host_ip_addr)
    self.listen_port = conf.get(CONF_LISTEN_PORT)
    if (not isinstance(self.listen_port, int)):
        self.listen_port = DEFAULT_LISTEN_PORT
        _LOGGER.info('Listen port not specified, defaulting to %s', self.listen_port)
    self.upnp_bind_multicast = conf.get(CONF_UPNP_BIND_MULTICAST, DEFAULT_UPNP_BIND_MULTICAST)
    self.off_maps_to_on_domains = conf.get(CONF_OFF_MAPS_TO_ON_DOMAINS)
    if (not isinstance(self.off_maps_to_on_domains, list)):
        self.off_maps_to_on_domains = DEFAULT_OFF_MAPS_TO_ON_DOMAINS
    self.expose_by_default = conf.get(CONF_EXPOSE_BY_DEFAULT, DEFAULT_EXPOSE_BY_DEFAULT)
    self.exposed_domains = conf.get(CONF_EXPOSED_DOMAINS, DEFAULT_EXPOSED_DOMAINS)
    self.advertise_ip = (conf.get(CONF_ADVERTISE_IP) or self.host_ip_addr)
    self.advertise_port = (conf.get(CONF_ADVERTISE_PORT) or self.listen_port)
    self.entities = conf.get(CONF_ENTITIES, {})
Initialize the instance.
def __init__(self, hass, conf):
    
    self.hass = hass
    self.type = conf.get(CONF_TYPE)
    self.numbers = None
    self.cached_states = {}
    if (self.type == TYPE_ALEXA):
        _LOGGER.warning('Emulated Hue running in legacy mode because type has been specified. More info at https://goo.gl/M6tgz8')
    self.host_ip_addr = conf.get(CONF_HOST_IP)
    if (self.host_ip_addr is None):
        self.host_ip_addr = util.get_local_ip()
        _LOGGER.info('Listen IP address not specified, auto-detected address is %s', self.host_ip_addr)
    self.listen_port = conf.get(CONF_LISTEN_PORT)
    if (not isinstance(self.listen_port, int)):
        self.listen_port = DEFAULT_LISTEN_PORT
        _LOGGER.info('Listen port not specified, defaulting to %s', self.listen_port)
    self.upnp_bind_multicast = conf.get(CONF_UPNP_BIND_MULTICAST, DEFAULT_UPNP_BIND_MULTICAST)
    self.off_maps_to_on_domains = conf.get(CONF_OFF_MAPS_TO_ON_DOMAINS)
    if (not isinstance(self.off_maps_to_on_domains, list)):
        self.off_maps_to_on_domains = DEFAULT_OFF_MAPS_TO_ON_DOMAINS
    self.expose_by_default = conf.get(CONF_EXPOSE_BY_DEFAULT, DEFAULT_EXPOSE_BY_DEFAULT)
    self.exposed_domains = conf.get(CONF_EXPOSED_DOMAINS, DEFAULT_EXPOSED_DOMAINS)
    self.advertise_ip = (conf.get(CONF_ADVERTISE_IP) or self.host_ip_addr)
    self.advertise_port = (conf.get(CONF_ADVERTISE_PORT) or self.listen_port)
    self.entities = conf.get(CONF_ENTITIES, {})