Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About air conditioner #1

Open
zuozhehao opened this issue Jun 20, 2021 · 1 comment
Open

About air conditioner #1

zuozhehao opened this issue Jun 20, 2021 · 1 comment

Comments

@zuozhehao
Copy link

Thank you for created such a good library.
Can you add an example of air conditioner?

@xxandev
Copy link
Owner

xxandev commented Nov 30, 2021

sorry for the delay in answering, i am using simple thermostat for air cond
but if you need to regulate the airflow, you can combine the two accessories
thermostat + fan / air purifier
(similar use case https://github.com/alpr777/homekit/blob/main/accessory_thermostat_automatic.go)

type AccessoryThermostatAC struct {
	*accessory.Accessory
	Thermostat struct {
		//	◈ CurrentHeatingCoolingState
		//	◈ TargetHeatingCoolingState
		//	◈ CurrentTemperature
		//	◈ TargetTemperature
		//	◈ TemperatureDisplayUnits
		//	◇ CoolingThresholdTemperature
		//	◇ HeatingThresholdTemperature
		//	◇ CurrentRelativeHumidity
		//	◇ TargetRelativeHumidity
		*service.Service
		CurrentHeatingCoolingState *characteristic.CurrentHeatingCoolingState
		TargetHeatingCoolingState  *characteristic.TargetHeatingCoolingState
		CurrentTemperature         *characteristic.CurrentTemperature
		TargetTemperature          *characteristic.TargetTemperature
		TemperatureDisplayUnits    *characteristic.TemperatureDisplayUnits
	}
	/*optional*/ AirPurifier struct {
		//	◈ Active
		//	◈ CurrentAirPurifierState
		//	◈ TargetAirPurifierState
		//	◇ RotationSpeed
		*service.Service
		Active                  *characteristic.Active
		CurrentAirPurifierState *characteristic.CurrentAirPurifierState
		TargetAirPurifierState  *characteristic.TargetAirPurifierState
		RotationSpeed           *characteristic.RotationSpeed
	}
	/*optional*/ Fan struct {
		//	◈ Active
		//	◇ CurrentFanState
		//	◇ TargetFanState
		//	◇ RotationDirection
		//	◇ RotationSpeed
		//	◇ SwingMode
		//	◇ LockPhysicalControls
		*service.Service
		Active        *characteristic.Active
		RotationSpeed *characteristic.RotationSpeed
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants