func (d *AdapterDigitalHumidityTemperature433) OnRead(dev *api.Thing, service *api.ThingService, data api.ReadRequest, handler api.ProtocolHandler) (state api.State) { dec := data.GetAsInt("dhtdata") mask := 0x7f humidity := mask & (dec >> 16) mask = 0xff tempHigh := mask & (dec >> 8) tempLow := mask & dec state = make(map[string]interface{}) state["h"] = humidity state["tH"] = tempHigh - 50 state["tL"] = tempLow return }