# Path: cbus/common.py
# class Application(IntEnum):
#     TEMPERATURE = 0x19
#     LIGHTING_FIRST = LIGHTING_30 = 0x30
#     LIGHTING_31 = 0x31
#     LIGHTING_32 = 0x32
#     LIGHTING_33 = 0x33
#     LIGHTING_34 = 0x34
#     LIGHTING_35 = 0x35
#     LIGHTING_36 = 0x36
#     LIGHTING_37 = 0x37
#     LIGHTING = LIGHTING_38 = 0x38
#     LIGHTING_39 = 0x39
#     LIGHTING_3a = 0x3a
#     LIGHTING_3b = 0x3b
#     LIGHTING_3c = 0x3c
#     LIGHTING_3d = 0x3d
#     LIGHTING_3e = 0x3e
#     LIGHTING_3f = 0x3f
#     LIGHTING_40 = 0x40
#     LIGHTING_41 = 0x41
#     LIGHTING_42 = 0x42
#     LIGHTING_43 = 0x43
#     LIGHTING_44 = 0x44
#     LIGHTING_45 = 0x45
#     LIGHTING_46 = 0x46
#     LIGHTING_47 = 0x47
#     LIGHTING_48 = 0x48
#     LIGHTING_49 = 0x49
#     LIGHTING_4a = 0x4a
#     LIGHTING_4b = 0x4b
#     LIGHTING_4c = 0x4c
#     LIGHTING_4d = 0x4d
#     LIGHTING_4e = 0x4e
#     LIGHTING_4f = 0x4f
#     LIGHTING_50 = 0x50
#     LIGHTING_51 = 0x51
#     LIGHTING_52 = 0x52
#     LIGHTING_53 = 0x53
#     LIGHTING_54 = 0x54
#     LIGHTING_55 = 0x55
#     LIGHTING_56 = 0x56
#     LIGHTING_57 = 0x57
#     LIGHTING_58 = 0x58
#     LIGHTING_59 = 0x59
#     LIGHTING_5a = 0x5a
#     LIGHTING_5b = 0x5b
#     LIGHTING_5c = 0x5c
#     LIGHTING_5d = 0x5d
#     LIGHTING_5e = 0x5e
#     LIGHTING_LAST = LIGHTING_5f = 0x5f
#     CLOCK = 0xDF
#     ENABLE = 0xCB
#     MASTER_APPLICATION = STATUS_REQUEST = 0xff
# 
# class EnableCommand(IntEnum):
#     SET_NETWORK_VARIABLE = 0x02
# 
# Path: cbus/protocol/application/sal.py
# class BaseApplication(abc.ABC):
#     """
#     Describes an decoder for all commands sent to an application.
#     """
# 
#     @staticmethod
#     @abc.abstractmethod
#     def supported_applications() -> FrozenSet[Union[int, Application]]:
#         """
#         Gets a list of supported Application IDs for the application.
# 
#         All application IDs must be in the range 0x00 - 0xff.
#         """
#         raise NotImplementedError('supported_applications')
# 
#     @staticmethod
#     @abc.abstractmethod
#     def decode_sals(data: bytes) -> Sequence[SAL]:
#         """
#         Decodes a SAL message
# 
#         """
#         raise NotImplementedError('decode_sals')
# 
# class SAL(abc.ABC):
#     """
#     Describes an decoder/encoder
# 
#     """
#     @abc.abstractmethod
#     def encode(self) -> bytes:
#         return bytes()
# 
#     @property
#     @abc.abstractmethod
#     def application(self) -> Union[int, Application]:
#         raise NotImplementedError('application')


import warnings
from typing import Set, List
from six import byte2int, indexbytes
from cbus.common import Application, EnableCommand
from cbus.protocol.application.sal import BaseApplication, SAL
        Do not call this method directly -- use EnableSAL.decode
        """

        # print "data == %r" % data
        variable = byte2int(data)
        value = indexbytes(data, 1)

        data = data[2:]

        return cls(variable, value), data

    def encode(self) -> bytes:
        variable = self.variable & 0xff
        value = self.value & 0xff

        return super().encode() + bytes([
            EnableCommand.SET_NETWORK_VARIABLE, variable, value
        ])


class EnableApplication(BaseApplication):
    """
    This class is called in the cbus.protocol.applications.APPLICATIONS dict in
    order to describe how to decode enable broadcast application events
    received from the network.

    Do not call this class directly.
    """

    @staticmethod

# Path: cbus/common.py
# class Application(IntEnum):
#     TEMPERATURE = 0x19
#     LIGHTING_FIRST = LIGHTING_30 = 0x30
#     LIGHTING_31 = 0x31
#     LIGHTING_32 = 0x32
#     LIGHTING_33 = 0x33
#     LIGHTING_34 = 0x34
#     LIGHTING_35 = 0x35
#     LIGHTING_36 = 0x36
#     LIGHTING_37 = 0x37
#     LIGHTING = LIGHTING_38 = 0x38
#     LIGHTING_39 = 0x39
#     LIGHTING_3a = 0x3a
#     LIGHTING_3b = 0x3b
#     LIGHTING_3c = 0x3c
#     LIGHTING_3d = 0x3d
#     LIGHTING_3e = 0x3e
#     LIGHTING_3f = 0x3f
#     LIGHTING_40 = 0x40
#     LIGHTING_41 = 0x41
#     LIGHTING_42 = 0x42
#     LIGHTING_43 = 0x43
#     LIGHTING_44 = 0x44
#     LIGHTING_45 = 0x45
#     LIGHTING_46 = 0x46
#     LIGHTING_47 = 0x47
#     LIGHTING_48 = 0x48
#     LIGHTING_49 = 0x49
#     LIGHTING_4a = 0x4a
#     LIGHTING_4b = 0x4b
#     LIGHTING_4c = 0x4c
#     LIGHTING_4d = 0x4d
#     LIGHTING_4e = 0x4e
#     LIGHTING_4f = 0x4f
#     LIGHTING_50 = 0x50
#     LIGHTING_51 = 0x51
#     LIGHTING_52 = 0x52
#     LIGHTING_53 = 0x53
#     LIGHTING_54 = 0x54
#     LIGHTING_55 = 0x55
#     LIGHTING_56 = 0x56
#     LIGHTING_57 = 0x57
#     LIGHTING_58 = 0x58
#     LIGHTING_59 = 0x59
#     LIGHTING_5a = 0x5a
#     LIGHTING_5b = 0x5b
#     LIGHTING_5c = 0x5c
#     LIGHTING_5d = 0x5d
#     LIGHTING_5e = 0x5e
#     LIGHTING_LAST = LIGHTING_5f = 0x5f
#     CLOCK = 0xDF
#     ENABLE = 0xCB
#     MASTER_APPLICATION = STATUS_REQUEST = 0xff
# 
# class EnableCommand(IntEnum):
#     SET_NETWORK_VARIABLE = 0x02
# 
# Path: cbus/protocol/application/sal.py
# class BaseApplication(abc.ABC):
#     """
#     Describes an decoder for all commands sent to an application.
#     """
# 
#     @staticmethod
#     @abc.abstractmethod
#     def supported_applications() -> FrozenSet[Union[int, Application]]:
#         """
#         Gets a list of supported Application IDs for the application.
# 
#         All application IDs must be in the range 0x00 - 0xff.
#         """
#         raise NotImplementedError('supported_applications')
# 
#     @staticmethod
#     @abc.abstractmethod
#     def decode_sals(data: bytes) -> Sequence[SAL]:
#         """
#         Decodes a SAL message
# 
#         """
#         raise NotImplementedError('decode_sals')
# 
# class SAL(abc.ABC):
#     """
#     Describes an decoder/encoder
# 
#     """
#     @abc.abstractmethod
#     def encode(self) -> bytes:
#         return bytes()
# 
#     @property
#     @abc.abstractmethod
#     def application(self) -> Union[int, Application]:
#         raise NotImplementedError('application')


# Path: cbus/protocol/application/enable.py
import warnings
from typing import Set, List
from six import byte2int, indexbytes
from cbus.common import Application, EnableCommand
from cbus.protocol.application.sal import BaseApplication, SAL

        Do not call this method directly -- use EnableSAL.decode
        """

        # print "data == %r" % data
        variable = byte2int(data)
        value = indexbytes(data, 1)

        data = data[2:]

        return cls(variable, value), data

    def encode(self) -> bytes:
        variable = self.variable & 0xff
        value = self.value & 0xff

        return super().encode() + bytes([
            EnableCommand.SET_NETWORK_VARIABLE, variable, value
        ])


class EnableApplication(BaseApplication):
    """
    This class is called in the cbus.protocol.applications.APPLICATIONS dict in
    order to describe how to decode enable broadcast application events
    received from the network.

    Do not call this class directly.
    """

    @staticmethod

    def supported_applications() -> Set[Application]: