|
| 1 | +# Version Management Guide |
| 2 | + |
| 3 | +## Single Source of Truth |
| 4 | + |
| 5 | +The version for Ultra Card Pro Cloud is managed in **one place only**: |
| 6 | + |
| 7 | +``` |
| 8 | +custom_components/ultra_card_pro_cloud/version.py |
| 9 | +``` |
| 10 | + |
| 11 | +## How to Change the Version |
| 12 | + |
| 13 | +1. **Edit `version.py`**: |
| 14 | + |
| 15 | + ```python |
| 16 | + __version__ = "1.0.1" # Change this number |
| 17 | + ``` |
| 18 | + |
| 19 | +2. **Sync to manifest.json** (choose one method): |
| 20 | + |
| 21 | + **Option A - Using npm:** |
| 22 | + |
| 23 | + ```bash |
| 24 | + npm run version:update |
| 25 | + ``` |
| 26 | + |
| 27 | + **Option B - Direct command:** |
| 28 | + |
| 29 | + ```bash |
| 30 | + node update-version.js |
| 31 | + ``` |
| 32 | + |
| 33 | +3. **Deploy** (automatic version sync included): |
| 34 | + |
| 35 | + ```bash |
| 36 | + npm run deploy |
| 37 | + ``` |
| 38 | + |
| 39 | + The deploy script automatically runs `update-version.js` before deploying. |
| 40 | + |
| 41 | +## Files Updated |
| 42 | + |
| 43 | +When you run `update-version.js`, it will: |
| 44 | + |
| 45 | +- ✅ Read version from `version.py` |
| 46 | +- ✅ Update `manifest.json` with the new version |
| 47 | +- ✅ Show you what changed |
| 48 | + |
| 49 | +## Where Version is Used |
| 50 | + |
| 51 | +The version appears in: |
| 52 | + |
| 53 | +- `manifest.json` - Home Assistant integration metadata |
| 54 | +- `__init__.py` - Logs during integration setup |
| 55 | +- Home Assistant logs when the integration starts |
| 56 | + |
| 57 | +## Example Workflow |
| 58 | + |
| 59 | +```bash |
| 60 | +# 1. Edit version.py in the root folder |
| 61 | +# Change: __version__ = "1.0.1" |
| 62 | + |
| 63 | +# 2. Sync the version to manifest.json (REQUIRED) |
| 64 | +npm run version:update |
| 65 | + |
| 66 | +# 3. Deploy to Home Assistant |
| 67 | +npm run deploy |
| 68 | +``` |
| 69 | + |
| 70 | +## Important Notes |
| 71 | + |
| 72 | +- 🎯 **Only edit `version.py` (root folder)** - don't manually edit `manifest.json` |
| 73 | +- ✋ **Manual control** - You must run `npm run version:update` before deploying |
| 74 | +- 📝 Version format: Use semantic versioning (e.g., `1.0.0`, `1.1.0`, `2.0.0-beta1`) |
| 75 | +- 📁 The `version.py` file is in the **root folder** for easy access (just like Ultra Card's `src/version.ts`) |
0 commit comments