Skip to content

Programming exercise for Educational Initiatives - Smart Home System

Notifications You must be signed in to change notification settings

deveshparmar/Educational_Initiatives

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 

Repository files navigation

Smart Home System

The Smart Home System is a Java-based application that simulates a smart home system, allowing us to control various smart devices such as lights, thermostats, and door locks via a central hub. Users can set schedules, automate tasks, view device status & reports, and manage triggers.

Built with

Java (JDK-20)

Getting started

  • Clone the repository
     git clone https://github.com/deveshparmar/Educational_Initiatives.git
  • Compile the project
    javac src/SmartHomeSystem/*.java src/SmartHomeSystemExceptions/*.java
  • Run the Main.java (Entry Point)
    java -cp src Main

Project Structure

  • src/ - Source code directory
    • SmartHomeSystem/ - Main package for the application
      • Device.java - Interface representing smart home devices
      • DeviceFactory.java - Factory class for creating devices
      • DeviceObserver.java - Interface for observing device updates
      • DeviceProxy.java - Proxy class for device access
      • Light.java - Class representing light devices
      • Thermostat.java - Class representing thermostat devices
      • Door.java - Class representing door devices
      • SmartHomeHub.java - Main smart home hub class
      • Trigger.java - Class for defining automation triggers
      • Schedule.java - Class for defining schedule for devices
      • Main.java - Application entry point
    • SmartHomeSystemExceptions/ - Package for custom exceptions
      • UnsupportedActionException.java - Custom exception for unsupported actions
      • InvalidTriggerException.java - Custom exception for invalid triggers
      • UnauthorizedAccess - Custom exception for unauthorized access of device

Features

  • Initialize the Smart Home System with different devices, each having a unique ID and type (light, thermostat, door lock).
  • Turn devices on/off.
  • Schedule devices to turn on/off at a particular time.
  • Automate tasks based on triggers.
  • Add and remove devices dynamically.
  • Custom exceptions for handling unsupported actions and invalid trigger conditions.
  • Logging for each component activity

UML diagram

image

Output Screenshots

  1. Output image

  2. Logging for error and Custom Exception image

About

Programming exercise for Educational Initiatives - Smart Home System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages