<commit_before>package main

// Type GetRequest is an enum holding the command types
// of all Get operations.
type GetRequest uint8

//
// get* requests
// Get information from the unit, no state is altered.
//

const (
	GetTemps  GetRequest = 0xD1 // getTemps gets all available temperatures from the unit.
	GetBypass            = 0xDF // getBypass gets heat exchanger information from the unit.
)

//
// set* requests
// Alter unit state or configuration
//

// SetRequest setSpeed controls the fan speed of the unit.
// The Speed member can range from 0 (away) to 4 (highest).
type setSpeed struct {
	Speed uint8
}

func (q setSpeed) Type() uint8 { return 0x99 }
func (q setSpeed) MarshalBinary() (out []byte, err error) {

	if q.Speed > 4 {
		return nil, errTooHigh
	}

	return []byte{q.Speed}, nil
}<commit_msg>Implement Comfort temperature setter<commit_after>package main

// Type GetRequest is an enum holding the command types
// of all Get operations.
type GetRequest uint8

//
// get* requests
// Get information from the unit, no state is altered.
//

const (
	GetTemps  GetRequest = 0xD1 // getTemps gets all available temperatures from the unit.
	GetBypass            = 0xDF // getBypass gets heat exchanger information from the unit.
)

//
// set* requests
// Alter unit state or configuration
//

// SetRequest setSpeed controls the fan speed of the unit.
// The Speed member can range from 0 (away) to 4 (highest).
type setSpeed struct {
	Speed uint8
}

func (q setSpeed) Type() uint8 { return 0x99 }
func (q setSpeed) MarshalBinary() (out []byte, err error) {

	if q.Speed > 4 {
		return nil, errTooHigh
	}

	return []byte{q.Speed}, nil
}

// SetRequest setComfort controls the comfort temperature
// of the unit. This is the point at which the heat exchanger
// will recover outgoing heat into the incoming air stream.
type setComfort struct {
	Temperature temperature
}

func (q setComfort) Type() uint8 { return 0xD3 }
func (q setComfort) MarshalBinary() (out []byte, err error) {

	t, err := q.Temperature.MarshalBinary()
	if err != nil {
		return
	}

	return []byte{t}, nil
}
{'fraction_non_alphanumeric': 0.09480705097665555, 'fraction_numerical': 0.012863268222963315, 'mean_word_length': 3.294478527607362, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5064215', 'n_tokens_mistral': 667, 'n_tokens_neox': 627, 'n_words': 274}