You are browsing as a guest. Sign up (or log in) to start making projects!

1h 25m 14s logged

Devlog #1: RoomOps Zero Core API & Smart Device Integration

Date: August 23, 2026
Project: RoomOps Zero
Status: In Progress (Backend Microservice Layer)


🛠️ Summary & Overview

Implemented the foundational REST API layer for RoomOps Zero using FastAPI to handle local hardware control and environmental telemetry. Integrated Tapo smart devices (L900 Light Strip & L535 Smart Bulb) using an asynchronous client library (tapo), structured via the Factory Design Pattern for modularity. Added an asynchronous weather integration module to feed current climate data directly to the central dashboard.


⚙️ Key Technical Updates

1. Asynchronous REST API (main.py)

  • Configured a FastAPI application running on 0.0.0.0:8080 via Uvicorn.
  • Defined explicit request validation models using Pydantic (TapoBaseModel).
  • Created non-blocking asynchronous routes for weather retrieval (GET) and smart device state management (POST).

2. Smart Lighting Integration (tapo_control.py)

  • Created async device wrappers (L900, L535) leveraging ApiClient from the tapo library.
  • Externalized hardware credentials (IPs, usernames, passwords) into a local .env file using python-dotenv.
  • Implemented a Singleton pattern for L535 to avoid redundant object instantiation.
  • Designed a DeviceFactory class to standardize turn_on and turn_off operations across varying hardware models based on incoming payloads.

3. Weather Telemetry Module (weather.py)

  • Integrated python_weather using metric units ($^\circ\text{C}$).
  • Structured as an async utility (get_temperature) to prevent blocking the primary event loop during HTTP requests.

📡 API Endpoints Reference

1. Get Current Weather

  • URL: GET /api/weather/{city}
  • Parameters: city (path parameter, string)
  • Response: Current metric temperature integer/float.

2. Control Tapo Device

  • URL: POST /api/tapo/control
  • Headers: Content-Type: application/json
  • Payload Example:
    {
      "device_name": "l900",
      "action": "turn_on"
    }
0
12

Comments 0

No comments yet. Be the first!