How to use the wled.models.Leds function in wled

To help you get started, we’ve selected a few wled examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frenck / python-wled / wled / models.py View on Github external
def from_dict(data: Dict[str, Any]) -> Leds:
        """Return Leds object from WLED API response."""
        leds = data.get("leds", {})
        return Leds(
            count=leds.get("count", 0),
            max_power=leds.get("maxpwr", 0),
            max_segments=leds.get("maxseg", 0),
            pin=leds.get("pin", 0),
            power=leds.get("pwr", 0),
            rgbw=leds.get("rgbw", False),
        )
github frenck / python-wled / wled / models.py View on Github external
rssi=wifi.get("rssi", 0),
            signal=wifi.get("signal", 0),
        )


@dataclass
class Info:
    """Object holding information from WLED."""

    architecture: str
    arduino_core_version: str
    brand: str
    build_type: str
    effect_count: int
    free_heap: int
    leds: Leds
    live_ip: str
    live_mode: str
    live: bool
    mac_address: str
    name: str
    pallet_count: int
    product: str
    udp_port: int
    uptime: int
    version_id: str
    version: str
    wifi: Optional[Wifi]

    @staticmethod
    def from_dict(data: Dict[str, Any]) -> Info:
        """Return Info object from WLED API response."""