# Path: cbus/common.py
# class ExtendedCALType(IntEnum):
#     BINARY = 0x00
#     LEVEL = 0x07
# 
# class GroupState(IntEnum):
#     MISSING = 0x00
#     ON = 0x01
#     OFF = 0x02
#     ERROR = 0x03


import abc
from dataclasses import dataclass
from typing import Iterator, Optional, Sequence
from cbus.common import ExtendedCALType, GroupState
    Under the hood, it's likely that every unit tries to transmit its state
    in response to this query in synchronisation, and if a unit is missing,
    the signal level stays low (ie: 00).

    """
    _group_states: Sequence[Optional[int]]

    def __getitem__(self, i: int) -> Optional[int]:
        return self._group_states[i]

    def __len__(self) -> int:
        return len(self._group_states)

    def __iter__(self) -> Iterator[Optional[int]]:
        return iter(self._group_states)

    @classmethod
    def decode(cls, data: bytes) -> LevelStatusReport:
        states = []
        if len(data) % 2 != 0:
            raise ValueError(
                'Expected a multiple of 2 bytes in LevelStatusReport')

        for o in range(0, len(data), 2):
            states.append(manchester_decode(data[o:o+2]))

        return LevelStatusReport(states)

    @property
    def block_type(self) -> ExtendedCALType:

# Path: cbus/common.py
# class ExtendedCALType(IntEnum):
#     BINARY = 0x00
#     LEVEL = 0x07
# 
# class GroupState(IntEnum):
#     MISSING = 0x00
#     ON = 0x01
#     OFF = 0x02
#     ERROR = 0x03


# Path: cbus/protocol/cal/report.py
import abc
from dataclasses import dataclass
from typing import Iterator, Optional, Sequence
from cbus.common import ExtendedCALType, GroupState

    Under the hood, it's likely that every unit tries to transmit its state
    in response to this query in synchronisation, and if a unit is missing,
    the signal level stays low (ie: 00).

    """
    _group_states: Sequence[Optional[int]]

    def __getitem__(self, i: int) -> Optional[int]:
        return self._group_states[i]

    def __len__(self) -> int:
        return len(self._group_states)

    def __iter__(self) -> Iterator[Optional[int]]:
        return iter(self._group_states)

    @classmethod
    def decode(cls, data: bytes) -> LevelStatusReport:
        states = []
        if len(data) % 2 != 0:
            raise ValueError(
                'Expected a multiple of 2 bytes in LevelStatusReport')

        for o in range(0, len(data), 2):
            states.append(manchester_decode(data[o:o+2]))

        return LevelStatusReport(states)

    @property
    def block_type(self) -> ExtendedCALType:

        return ExtendedCALType.LEVEL