Skip to content

[SENSOR] Create sensor base class with JSON output #4

Closed
ezehf2 opened this issue Mar 5, 2026 · 0 comments
Closed

[SENSOR] Create sensor base class with JSON output #4

ezehf2 opened this issue Mar 5, 2026 · 0 comments
Assignees

Comments

@ezehf2
Copy link
Owner

ezehf2 commented Mar 5, 2026

Create a Python file called sensor_base.py containing a base class that all four sensor types will inherit from. The class should store the sensor type, the room ID, and a method called generate_reading() that returns a properly formatted JSON message containing the sensor type, room, value, unit, and a timestamp. No broker connection is needed at this stage — the class just needs to produce correctly structured output that can later be published via MQTT.

Sign in to join this conversation on GitHub.
Labels
None yet
Development

No branches or pull requests

2 participants