diff --git a/drivers/SmartThings/jbl/src/discovery.lua b/drivers/SmartThings/jbl/src/discovery.lua index 3b96cc66a1..92150d6efa 100644 --- a/drivers/SmartThings/jbl/src/discovery.lua +++ b/drivers/SmartThings/jbl/src/discovery.lua @@ -4,6 +4,7 @@ local fields = require "fields" local discovery_mdns = require "discovery_mdns" local socket = require "cosock.socket" +local st_utils = require "st.utils" local discovery = {} @@ -68,6 +69,8 @@ local function discovery_device(driver) local ip_table = discovery.find_ip_table(driver) + log.debug(st_utils.stringify_table(ip_table, "DNI IP Table after processing mDNS Discovery Response", true)) + for dni, ip in pairs(ip_table) do log.info(string.format("discovery_device dni, ip = %s, %s", dni, ip)) if not known_devices or not known_devices[dni] then diff --git a/drivers/SmartThings/jbl/src/discovery_mdns.lua b/drivers/SmartThings/jbl/src/discovery_mdns.lua index 4d0dce9061..cb38ceeb32 100644 --- a/drivers/SmartThings/jbl/src/discovery_mdns.lua +++ b/drivers/SmartThings/jbl/src/discovery_mdns.lua @@ -1,6 +1,7 @@ local log = require "log" local mdns = require "st.mdns" local net_utils = require "st.net_utils" +local st_utils = require "st.utils" local discovery_mdns = {} @@ -126,6 +127,8 @@ local function get_dni_ip_table_from_mdns_responses(driver, service_type, domain local filtered_responses = filter_response_by_service_name(service_type, domain, discovery_responses) + log.debug(st_utils.stringify_table(filtered_responses, "[get_dni_ip_table(...)] Filtered Responses", true)) + insert_dni_ip_from_answers(driver, filtered_responses, dni_ip_table) insert_dni_ip_from_found(driver, filtered_responses, dni_ip_table) @@ -138,9 +141,11 @@ function discovery_mdns.find_ip_table_by_mdns(driver) local service_type, domain = driver.discovery_helper.get_service_type_and_domain() local discovery_responses = mdns.discover(service_type, domain) or {found = {}} + log.debug(st_utils.stringify_table(discovery_responses, "Raw mDNS Discovery Response", true)) + local dni_ip_table = get_dni_ip_table_from_mdns_responses(driver, service_type, domain, discovery_responses) return dni_ip_table end -return discovery_mdns \ No newline at end of file +return discovery_mdns