# Path: cbus/common.py
# class CAL(IntEnum):
#     RESET = 0x08
#     RECALL = 0x1a
#     IDENTIFY = 0x21
#     GET_STATUS = 0x2a
#     ACKNOWLEDGE = 0x32
# 
#     # These are bit-masks
#     REPLY = 0x80
#     STANDARD_STATUS = 0xc0
#     EXTENDED_STATUS = 0xe0
# 
# class IdentifyAttribute(IntEnum):
#     """
#     IDENTIFY attributes.
# 
#     See Serial Interface Guide, s7.2.
#     """
#     MANUFACTURER = 0x00
#     TYPE = 0x01
#     FIRMWARE_VER = 0x02
#     SUMMARY = 0x03
#     EXTENDED = 0x04
#     NET_TERM_LVL = 0x05
#     TERM_LVL = 0x06
#     NET_VOLTAGE = 0x07
#     GAV_CURRENT = 0x08
#     GAV_STORED = 0x09
#     GAV_PHY_ADDR = 0x0A
#     LOGIC_ASSIGN = 0x0B
#     DELAYS = 0x0C
#     MIN_LVL = 0x0D
#     MAX_LVL = 0x0E
#     CUR_LVL = 0x0F
#     OUT_SUMMARY = 0x10
#     DSI_STATUS = 0x11


from dataclasses import dataclass
from typing import Tuple, Union
from cbus.common import CAL, IdentifyAttribute
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import
from __future__ import annotations



__all__ = [
    'IdentifyCAL',
]


@dataclass
class IdentifyCAL:
    """
    Identify CAL request.

    Ref: Serial Interface Guide, s7.1

    """
    attribute: Union[IdentifyAttribute, int]

    @classmethod
    def decode_cal(cls, data: bytes) -> Tuple[IdentifyCAL, int]:
        """
        Decodes identify SAL.
        """


# Path: cbus/common.py
# class CAL(IntEnum):
#     RESET = 0x08
#     RECALL = 0x1a
#     IDENTIFY = 0x21
#     GET_STATUS = 0x2a
#     ACKNOWLEDGE = 0x32
# 
#     # These are bit-masks
#     REPLY = 0x80
#     STANDARD_STATUS = 0xc0
#     EXTENDED_STATUS = 0xe0
# 
# class IdentifyAttribute(IntEnum):
#     """
#     IDENTIFY attributes.
# 
#     See Serial Interface Guide, s7.2.
#     """
#     MANUFACTURER = 0x00
#     TYPE = 0x01
#     FIRMWARE_VER = 0x02
#     SUMMARY = 0x03
#     EXTENDED = 0x04
#     NET_TERM_LVL = 0x05
#     TERM_LVL = 0x06
#     NET_VOLTAGE = 0x07
#     GAV_CURRENT = 0x08
#     GAV_STORED = 0x09
#     GAV_PHY_ADDR = 0x0A
#     LOGIC_ASSIGN = 0x0B
#     DELAYS = 0x0C
#     MIN_LVL = 0x0D
#     MAX_LVL = 0x0E
#     CUR_LVL = 0x0F
#     OUT_SUMMARY = 0x10
#     DSI_STATUS = 0x11


# Path: cbus/protocol/cal/identify.py
from dataclasses import dataclass
from typing import Tuple, Union
from cbus.common import CAL, IdentifyAttribute

#
# You should have received a copy of the GNU Lesser General Public License
# along with this library.  If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import
from __future__ import annotations



__all__ = [
    'IdentifyCAL',
]


@dataclass
class IdentifyCAL:
    """
    Identify CAL request.

    Ref: Serial Interface Guide, s7.1

    """
    attribute: Union[IdentifyAttribute, int]

    @classmethod
    def decode_cal(cls, data: bytes) -> Tuple[IdentifyCAL, int]:
        """
        Decodes identify SAL.
        """


        return IdentifyCAL(IdentifyAttribute(data[1])), 2