class Constants:
    def __setattr__(self, name, value):
        raise AttributeError(f"Cannot modify constant {name}")


class NotifyChangeType(Constants):
    # 定义常量成员
    DEVICE_CREATE = "device_create"
    DEVICE_UPDATE = "device_update"
    DEVICE_DELETE = "device_delete"
    MODEL_CREATE = "model_create"  # 模型新增不用通知，与设备绑定时才生效
    MODEL_UPDATE = "model_update"
    MODEL_DELETE = "model_delete"  # 正在使用的模型不能直接删除
    DEVICE_MODEL_RELATION_CREATE = "device_model_relation_create"
    DEVICE_MODEL_RELATION_UPDATE = "device_model_relation_update"  # 绑定关系变化 应该只用这个吧？？
    DEVICE_MODEL_RELATION_DELETE = "device_model_relation_delete"

    SCENE_UPDATE = "scene_update"
    DEVICE_SCENE_RELATION_UPDATE = "device_model_relation_update"

class DEVICE_TYPE(Constants):
    CAMERA = 1
    TREE = 2


class TREE_COMMAND(Constants):
    # 甲烷查询指令
    GAS_QUERY = b'\xAA\x01\x00\x95\x00\x00\x96'

class DEVICE_MODE(Constants):
    ALGO = 1
    SCENE = 2
    NONE = 0

class PUSH_TYPE(Constants):
    GAS = 1
    ALGO_RESULT = 2
    ALARM = 3
    HARMFUL_GAS = 4
