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

How to build own accessory? #60

Closed
TribuneX opened this issue Sep 11, 2016 · 1 comment
Closed

How to build own accessory? #60

TribuneX opened this issue Sep 11, 2016 · 1 comment

Comments

@TribuneX
Copy link

I am trying to extend the thermometer to support additional sensors such as a carbon dioxide sensor and an humidity sensor. It is not really clear to me how to integrate those additional services. Might be due to my very limited golang experience. Could you provide some example on how to add an additional service to an accessory?

@brutella
Copy link
Owner

An accessory is just a container for services. You should make a new accessory and add a temperature, co2 and humidity sensor service to the accessory.

type MyAccessory struct {
    *Accessory

    Temperature *service.TemperatureSensor
    CO2 *service.CarbonDioxideSensor
    Humidity *service.HumiditySensor
}

func NewMyAccessory() *MyAccessory {
    ...
}

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