A Java-based Smart Home CLI for managing devices, rooms, rules, and scenes. Demonstrates object-oriented design, SOLID principles, custom exceptions, and testing.
- Devices: Light, Thermostat, Security Camera
- Rooms: Add/remove rooms, assign devices
- Scenes: Group device actions (e.g., “Movie Night”)
- Rules: Automate actions based on events/time
- Notifications: Alerts when rules are triggered
- Custom Exceptions:
DeviceNotFoundException
– when a device does not existRoomNotFoundException
– when a room does not existInvalidCommandException
– for invalid CLI inputRuleConflictException
– when rules conflictSceneExecutionException
– when a scene fails to execute
./gradlew run --console=plain
./gradlew test
1. Add Room
2. Add Device
3. List Rooms
4. Trigger Scene
5. Configure Rule
6. Exit
> Add Room: Living Room
> Add Device: Light L1, Thermostat T1, Camera C1
> Create Scene: Night Comfort → Lights off, Thermostat 68°F, Camera records
> Rule: At 11PM trigger "Night Comfort"
- S: Each class has one role
- O: Add new devices/scenes without changing existing code
- L: All devices substitute the base
Device
type - I:
NotificationService
exposes only necessary behavior - D: High-level modules depend on abstractions, not concrete implementations