Skip to content

Releases: techie-labs/volta

v1.1.0

08 May 10:24

Choose a tag to compare

Volta 1.0.0 ⚡ — Stable Release

We're proud to announce the first stable release of Volta — a powerful, reactive Kotlin Multiplatform battery library for monitoring battery health, charging status, and advanced diagnostics across Android, iOS, Desktop, and Web.

🎉 What's in 1.0.0

Stable API

All core APIs introduced in 1.0.0-rc01 are now considered stable:

  • Volta Interface — Interface-driven architecture for clean separation and testability.
  • VoltaFactory — Factory pattern for creating platform-specific instances.
  • VoltaSensorState — Type-safe sealed interface for hardware state handling (Available, Loading, PermissionDenied, HardwareNotSupported, Error).
  • rememberBatteryState() — Compose Multiplatform hook for reactive battery data.

🔧 Improvements Since RC

  • Fixed Maven Central metadata — POM URLs now correctly point to the canonical repository (techie-labs/volta).
  • Added LICENSE file — Apache 2.0 license file at repository root for proper GitHub detection.
  • Enhanced README — Added Table of Contents, comparison table, FAQ section, and SEO-optimized documentation.

📦 Modules

All three modules are published on Maven Central:

Module Description
volta Core KMP library — battery monitoring, diagnostics, StateFlow API
volta-ui-compose Compose Multiplatform widgets (VoltaBatteryIcon, ThermalWarningBanner)
volta-mock Mock provider for Compose Previews and Unit Tests

🛠️ Developer Tools

  • Smart Sync — Rule-based execution engine for battery-aware background tasks.
  • Battery Profiler — Session-based battery consumption analytics.
  • Diagnostic Dump — Instant hardware state snapshots for crash reporting.

📱 Platform Support

Platform Status
Android (API 24+)
iOS (arm64, simulatorArm64)
Desktop — Windows
Desktop — macOS
Desktop — Linux
Web (WasmJs)

📦 Installation

commonMain.dependencies {
    implementation("io.github.techie-labs:volta:1.0.0")
    implementation("io.github.techie-labs:volta-ui-compose:1.0.0")
    implementation("io.github.techie-labs:volta-mock:1.0.0")
}

📋 Migration from RC / Beta

If upgrading from 1.0.0-rc01, no API changes are required — just update the version number.

If upgrading from 1.0.0-beta02 or earlier, see the RC01 migration guide.


Built with ⚡ by Techie Labs · Created by Fangga Dewangga

v1.0.0-rc01

28 Apr 07:24

Choose a tag to compare

Volta v1.0.0-rc01 ⚡

We are thrilled to announce Volta v1.0.0-rc01! This release brings a massive architectural overhaul, transitioning Volta into a true Enterprise-grade Kotlin Multiplatform library. We've completely redesigned the core API to be interface-driven, ensuring maximum testability, bulletproof state handling, and a rock-solid CI/CD pipeline.

🚀 What's New

🏗️ Interface-Driven

  • Volta Interface: The core library is no longer a rigid Singleton. The new Volta interface completely decouples hardware implementations from your business logic, unlocking powerful mocking and Dependency Injection capabilities.
  • Factory Pattern: Introduced VoltaFactory.create() to construct platform-specific implementations safely using Kotlin's expect/actual mechanism.
  • Encapsulation: All native providers (AndroidBatteryStateProvider, WasmBatteryStateProvider, etc.) are now marked as internal, preventing accidental access and enforcing clean architecture boundaries.

🛡️ Type-Safe Hardware States

  • VoltaSensorState: We introduced a new sealed interface to represent hardware states dynamically. Instead of returning raw or nullable BatteryState models, Volta now explicitly returns:
    • Loading: Connecting to native battery sensors.
    • Available: Successfully reading battery data.
    • PermissionDenied: Indicates missing OS-level permissions.
    • HardwareNotSupported: Graceful fallback for devices without battery APIs.
    • Error: Catches low-level sensor crashes safely.
  • Compose Multiplatform Updates: rememberBatteryState() now returns State<VoltaSensorState<BatteryState>>, allowing you to build exhaustive when blocks in Compose to render Loading/Error UIs cleanly.

🧪 Enhanced Testing & Mocking (volta-mock)

  • VoltaMock has been fully refactored to implement the new Volta interface.
  • You can now deterministically simulate complex hardware states (e.g., dropping battery level to 5% with Power Saving enabled) inside Compose Previews and JUnit tests without needing physical devices.

🌐 WebAssembly (Wasm) Improvements

  • Fixed Shadow DOM rendering issues (attachShadow) affecting Compose Multiplatform for Web.
  • Stabilized navigator.getBattery() bindings with robust fallbacks for browsers that aggressively block the HTML5 Battery Status API.

🛠️ CI/CD & Build Matrix

  • macOS Build Matrix Expanded: Added jvmTest (for pmset validation) and iosSimulatorArm64Test to the macOS GitHub Actions runner.
  • Windows Integration Testing: Introduced a dedicated windows-latest CI job to explicitly validate WMIC and powercfg desktop implementations.
  • Fixed Maven Publication: GitHub Actions publish.yml now correctly executes on macos-latest to ensure iOS/macOS artifacts (klibs) are properly published to Maven Central.
  • Cleaned up all Spotless and KtLint warnings across all targets.

📦 Upgrading

To upgrade to the RC, update your build.gradle.kts:

commonMain.dependencies {
    implementation("io.github.techie-labs:volta:1.0.0-rc01")
    implementation("io.github.techie-labs:volta-ui-compose:1.0.0-rc01")
    implementation("io.github.techie-labs:volta-mock:1.0.0-rc01")
}

📋 Migration Guide

If you are coming from 1.0.0-beta02 or earlier, you will need to update your code:

Old Usage:

val batteryProvider = BatteryStateProvider()
val state = batteryProvider.battery.value

New Usage:

val volta = VoltaFactory.create()
volta.startMonitoring()
val state = volta.batteryState.value // Returns VoltaSensorState

Compose UI Migration:

// Old
val battery by rememberBatteryState()
Text("${battery.level}")

// New
val sensorState by rememberBatteryState()
when (sensorState) {
    is VoltaSensorState.Available -> Text("${(sensorState as VoltaSensorState.Available).data.level}")
    is VoltaSensorState.Loading -> Text("Loading...")
    else -> Text("Error/Unsupported")
}

Built with ⚡ by Techie Labs

v1.0.0-beta02

30 Mar 02:50

Choose a tag to compare

🚀 Volta 1.0.0-beta02 — Initial Beta Release

We're excited to announce the first beta release of Volta ⚡ — a Kotlin Multiplatform Battery Library for monitoring battery health, charging status, and advanced diagnostics across multiple platforms with a single, unified API.

✨ Features

Core

  • Unified KMP API — Single interface for battery monitoring across Android, iOS, and Desktop (Windows, macOS, Linux)
  • Reactive State Management — Built on Kotlin StateFlow for seamless integration with modern UI architectures
  • Compose Multiplatform Ready — Includes rememberBatteryState() composable hook for instant UI updates

Battery Information

  • 🔋 Battery level & charging status
  • ⚡ Charging source detection (USB, AC, Wireless)
  • 🌡️ Temperature monitoring
  • 🔌 Voltage reading
  • 🔄 Cycle count tracking
  • 📊 Current (mA) measurement
  • 🏥 Battery health diagnostics
  • 🔧 Battery technology detection

Smart Detection

  • ⚠️ Power Saving Mode detection
  • 🛡️ Safe Mode detection
  • 🔒 Protected Battery (80% charge limit) detection

📱 Platform Support

Platform Status
Android (API 24+)
iOS (arm64, simulatorArm64)
Desktop — Windows
Desktop — macOS
Desktop — Linux
Web (Wasm)

📦 Installation

Add Volta to your commonMain dependencies:

commonMain.dependencies {
    implementation("io.github.techie-labs:volta:1.0.0-beta02")
}

🙏 Acknowledgements

Built with ⚡ by Techie Labs