A TRMNL e-ink display plugin that shows rotating fruit facts and nutritional information using the Fruityvice API. Perfect for learning about different fruits and their nutritional content.
- Displays detailed fruit information including:
- Nutritional facts (calories, carbs, protein, fat, sugar)
- Scientific classification (family, genus, order)
- Common name and identification
- Automatically rotates through different fruits
- Optimized for e-ink displays
- Built-in caching to minimize API calls
- Development mode for easy testing
- Python 3.12+
- TRMNL device and API key (for production use)
- Clone the repository:
git clone https://github.com/OptimumMeans/TRMNL-Fruit-Facts.git
cd TRMNL-Fruit-Facts- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Run in development mode:
python -m src.appThe application will start and open your browser to display the fruit facts.
No configuration needed - just run the application and it will work with default settings.
Create a .env file with your TRMNL credentials:
DEV_MODE=False
TRMNL_API_KEY=your_api_key_here
TRMNL_PLUGIN_UUID=your_plugin_uuid_here
REFRESH_INTERVAL=3600 # How often to refresh the display (in seconds)
FRUIT_ROTATION_INTERVAL=86400 # How often to change fruits (in seconds)
The plugin uses a clean, organized layout that includes:
- Large fruit name header
- Nutrition facts panel with key nutritional information
- Scientific classification panel
- Status bar showing update time and fruit count
├── src/
│ ├── app.py # Main application
│ ├── config.py # Configuration management
│ ├── services/
│ │ ├── api_service.py # Fruityvice API integration
│ │ └── display.py # E-ink display generation
│ └── utils/
│ ├── formatters.py # Data formatting utilities
│ └── validators.py # Data validation
└── tests/
└── test_display.py # Display tests
Run the test suite:
python -m pytest tests/-
Set up your TRMNL device and get your API credentials
-
Update your
.envfile with production settings:
DEV_MODE=False
DEBUG=False
HOST=0.0.0.0
PORT=8080
- Deploy using render.yaml configuration:
render deployREFRESH_INTERVAL: How often the display updatesFRUIT_ROTATION_INTERVAL: How often to show a new fruitCACHE_TIMEOUT: How long to cache API responses
DISPLAY_WIDTH: Width of the display (default: 800)DISPLAY_HEIGHT: Height of the display (default: 480)
- JSON response instead of bitmap: Make sure you're accessing the
/webhookendpoint - Connection errors: Check your internet connection for API access
- Display not updating: Verify your refresh intervals are set correctly
- Fruit data provided by Fruityvice API
- Based on TRMNL Plugin Boilerplate
MIT