# Copyright (C) 2020 Advanced Media Workflow Association
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from . import Config as CONFIG

# Copy this file to "UserConfig.py" to change configuration values.

# Example of setting ENABLE_HTTPS, any value from Config.py can be overridden using the same pattern.
CONFIG.ENABLE_HTTPS = False

CONFIG.ENABLE_DNS_SD = False
# CONFIG.ENABLE_DNS_SD = True
CONFIG.DNS_SD_MODE = 'unicast'
#CONFIG.DNS_SD_MODE = 'multicast'

# Read the registry host/port from the environment variables set by the
# IPMX-SETUP-XYZ scripts, falling back to these defaults if they are not set.
CONFIG.QUERY_API_HOST = os.environ.get('IPMX_REGISTRY_ADDRESS', '25.30.10.45')
CONFIG.QUERY_API_PORT = int(os.environ.get('IPMX_REGISTRY_PORT', 8870))

# CONFIG.IS11_REFERENCE_SENDER_CONNECTION_API_URL = "http://127.0.0.1:7051/x-nmos/connection/v1.1/"
# CONFIG.IS11_REFERENCE_SENDER_NODE_API_URL = "http://127.0.0.1:7051/x-nmos/node/v1.3/"
CONFIG.IS11_REFERENCE_SENDER_CONNECTION_API_URL = "http://25.30.10.163:5050/x-nmos/connection/v1.1/"
CONFIG.IS11_REFERENCE_SENDER_NODE_API_URL = "http://25.30.10.163:5050/x-nmos/node/v1.3/"

# The "any" value should work in most cases but in some scenarios the specific interface
# IP address must be specified in order to join on the proper network interface.
# CONFIG.MULTICAST_INTERFACE = "any"
CONFIG.MULTICAST_INTERFACE = "25.30.10.214"

# A multicast address that is known not to be used by any DuT
CONFIG.MULTICAST_STREAM_TARGET = '239.1.0.100'

# Make sure no one fail because accesses are slow
CONFIG.HTTP_TIMEOUT=30

# Reference Kramer source taking a long time to respond
CONFIG.STABLE_STATE_ATTEMPTS=10

# Manually check that the DuT produces an EDID with expected refresh/sample rate
# CONFIG.IS11_SOURCE_EDID_VERIFICATION=True
CONFIG.IS11_SOURCE_EDID_VERIFICATION=False

# Geneva testing event required to have this set form 3 to 10
CONFIG.API_PROCESSING_TIMEOUT=10