"""Zero-valued metrics provider used when no real source is available."""

from __future__ import annotations

from .types import MemorySnapshot, ProcessSnapshot, ThermalSnapshot


class NullMetricsProvider:
    """Returns zeros for every metric.

    Used on platforms where psutil is unavailable (Android/Chaquopy) and
    no platform-native provider is wired up yet. The dashboard still
    renders; charts just stay flat at zero instead of crashing.
    """

    available: bool = False

    def cpu_percent(self) -> float:
        return 0.0

    def cpu_count(self) -> int:
        return 1

    def virtual_memory(self) -> MemorySnapshot:
        return MemorySnapshot(used_bytes=0, total_bytes=0, percent=0.0)

    def process_snapshot(self) -> ProcessSnapshot:
        return ProcessSnapshot(cpu_percent=0.0, rss_bytes=0)

    def thermals(self) -> ThermalSnapshot:
        return ThermalSnapshot()
