toDouble

Maps a DigitalState to a numeric value suitable for time-series graphing and calculation nodes: ON → 1.0, OFF → 0.0.

The try/catch is a defensive guard for corner cases where the enum reference itself is somehow invalid at runtime (e.g., when a future platform deserialises an unknown ordinal); on any failure the safe fallback 0.0 is returned so downstream math never sees NaN.