@classmethod
def create_hap_event(cls, bytesdata):
    """Creates a HAP HTTP EVENT response for the given data.

        @param data: Payload of the request.
        @type data: bytes
        """
    return cls.EVENT_MSG_STUB + str(len(bytesdata)).encode('utf-8'
        ) + b'\r\n' * 2 + bytesdata
