Merge pull request #1230 from PepperDash/room-loading-protections

This commit is contained in:
Neil Dorin
2025-03-31 11:58:14 -06:00
committed by GitHub

View File

@@ -483,11 +483,13 @@ namespace PepperDash.Essentials
{ {
var room = Core.DeviceFactory.GetDevice(roomConfig); var room = Core.DeviceFactory.GetDevice(roomConfig);
DeviceManager.AddDevice(room); if(room == null)
if (room is ICustomMobileControl)
{ {
Debug.LogWarning("ERROR: Cannot load unknown room type '{roomType:l}', key '{roomKey:l}'.", roomConfig.Type, roomConfig.Key);
continue; continue;
} }
DeviceManager.AddDevice(room);
} catch (Exception ex) } catch (Exception ex)
{ {
Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type); Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type);