How hassan-darwish/smart-home-automation-system works
This C++ prototype provides a CLI for creating and controlling smart-home devices, organizing them into groups, and activating automations. The main workflow runs from the CLI controller through device creation or command execution to device state changes; automations also use sensors and the scheduler. The README documents additional device and command capabilities. Several implementation files were not sampled, so edges for those documented behaviors cite the README rather than implying their call details were inspected.
Main entry points: SmartHomeController.cpp CLI Controller · SecurityMode.cpp Security Mode · Devices Smart Devices · DeviceGroup.cpp Device Groups
Components 16
Control and Creation
- Application Entry
main.cpp - CLI Controller
src/Controllers/SmartHomeController.cpp - Device Factory
src/Factory/DeviceFactory.cpp
Devices and Groups
- Smart Devices
src/Devices - Device Groups
src/Devices/DeviceGroup.cpp - Lights
src/Devices/Lights - Thermostats
src/Devices/Thermostats - Cameras
src/Devices/Cameras/BaseCamera.cpp - Door Lock
src/Devices/DoorLock.cpp - Motion Sensor
src/Devices/MotionSensor.cpp
Automation
- Security Mode
src/Automation/SecurityMode.cpp - Energy Saving
src/Automation/EnergySavingMode.cpp - Task Scheduler
src/Controllers/Scheduler.cpp - Event Logger
src/Utils/Logger.cpp
Commands and Support
- Device Commands
src/Commands
Other components
- CLI User
Connections 24
- CLI User → Application Entry: starts
README.md - Application Entry → CLI Controller: runs
main.cpp - CLI User → CLI Controller: uses CLI
README.md - CLI Controller → Device Factory: creates devices
src/Controllers/SmartHomeController.cpp - Device Factory → Smart Devices: creates instances
README.md - CLI Controller → Device Commands: controls devices
README.md - CLI Controller → Device Groups: manages groups
README.md - Device Groups → Smart Devices: controls members
README.md - Smart Devices → Lights: includes
README.md - Smart Devices → Thermostats: includes
README.md - Smart Devices → Cameras: includes
README.md - Smart Devices → Door Lock: includes
README.md - Smart Devices → Motion Sensor: includes
README.md - CLI Controller → Security Mode: activates
README.md - CLI Controller → Energy Saving: activates
README.md - Security Mode → Device Groups: checks devices
src/Automation/SecurityMode.cpp - Security Mode → Motion Sensor: checks motion
src/Automation/SecurityMode.cpp - Security Mode → Door Lock: checks lock
src/Automation/SecurityMode.cpp - Security Mode → Cameras: starts recording
src/Automation/SecurityMode.cpp - Security Mode → Device Commands: executes recording
src/Automation/SecurityMode.cpp - Security Mode → Event Logger: logs events
src/Automation/SecurityMode.cpp - Energy Saving → Task Scheduler: schedules shutdown
README.md - Energy Saving → Device Groups: turns off idle groups
README.md - CLI Controller → Task Scheduler: uses delayed tasks
README.md