示例#1
0
        private void AddRoom(ServiceDTO serviceDto, RoomBuilder roomBuilder)
        {
            var area = new AttachedPropertyDTO
            {
                AttachedActor = roomBuilder.Name,
                Properties    = new Dictionary <string, string>()
            };

            if (!string.IsNullOrWhiteSpace(_workingTime))
            {
                area.Properties[MotionProperties.WorkingTime] = _workingTime;
            }

            foreach (var property in roomBuilder.Properties)
            {
                area.Properties[property.Key] = property.Value;
            }

            foreach (var detector in roomBuilder.Detectors.Values)
            {
                AddMotionSensor(detector.DetectorName, roomBuilder.Name, detector.Neighbors, serviceDto);
            }


            serviceDto.AreasAttachedProperties.Add(area);
        }
示例#2
0
 public LightAutomationServiceBuilder WithRoom(RoomBuilder room)
 {
     _rooms.Add(room.Name, room);
     return(this);
 }