func (v *ValueID) GetAsShort() (int16, error) {
	return GetValueAsShort(v.HomeID, v.ID)
}
GetAsShort returns the value as a 16-bit signed integer. It will also
return an error if the value is not of 16-bit signed integer type.
package goopenzwave
import "C"
import (
	"fmt"
)
type ValueIDGenre int
const (
	ValueIDGenreBasic ValueIDGenre = iota
	ValueIDGenreUser
	ValueIDGenreConfig
	ValueIDGenreSystem
	ValueIDGenreCount
)
func (v ValueIDGenre) String() string {
	switch v {
	case ValueIDGenreBasic:
		return "Basic"
	case ValueIDGenreUser:
		return "User"
	case ValueIDGenreConfig:
		return "Config"
	case ValueIDGenreSystem:
		return "System"
	case ValueIDGenreCount:
		return "Count"
	}
	return "UNKNOWN"
}
type ValueIDType int
const (
	ValueIDTypeBool ValueIDType = iota
	ValueIDTypeByte
	ValueIDTypeDecimal
	ValueIDTypeInt
	ValueIDTypeList
	ValueIDTypeSchedule
	ValueIDTypeShort
	ValueIDTypeString
	ValueIDTypeButton
	ValueIDTypeRaw
	ValueIDTypeMax
)
func (v ValueIDType) String() string {
	switch v {
	case ValueIDTypeBool:
		return "Bool"
	case ValueIDTypeByte:
		return "Byte"
	case ValueIDTypeDecimal:
		return "Decimal"
	case ValueIDTypeInt:
		return "Int"
	case ValueIDTypeList:
		return "List"
	case ValueIDTypeSchedule:
		return "Schedule"
	case ValueIDTypeShort:
		return "Short"
	case ValueIDTypeString:
		return "String"
	case ValueIDTypeButton:
		return "Button"
	case ValueIDTypeRaw:  
		return "Raw/Max"
	}
	return "UNKNOWN"
}
type ValueID struct {
	HomeID         uint32
	NodeID         uint8
	Genre          ValueIDGenre
	CommandClassID uint8
	Instance       uint8
	Index          uint8
	Type           ValueIDType
	ID             uint64
}
func buildValueID(v C.valueid_t) *ValueID {
	vid := &ValueID{
		HomeID:         uint32(C.valueid_getHomeId(v)),
		NodeID:         uint8(C.valueid_getNodeId(v)),
		CommandClassID: uint8(C.valueid_getCommandClassId(v)),
		Instance:       uint8(C.valueid_getInstance(v)),
		Index:          uint8(C.valueid_getIndex(v)),
		ID:             uint64(C.valueid_getId(v)),
	}
	switch C.valueid_getGenre(v) {
	case C.valueid_genre_basic:
		vid.Genre = ValueIDGenreBasic
	case C.valueid_genre_user:
		vid.Genre = ValueIDGenreUser
	case C.valueid_genre_config:
		vid.Genre = ValueIDGenreConfig
	case C.valueid_genre_system:
		vid.Genre = ValueIDGenreSystem
	case C.valueid_genre_count:
		vid.Genre = ValueIDGenreCount
	}
	switch C.valueid_getType(v) {
	case C.valueid_type_bool:
		vid.Type = ValueIDTypeBool
	case C.valueid_type_byte:
		vid.Type = ValueIDTypeByte
	case C.valueid_type_decimal:
		vid.Type = ValueIDTypeDecimal
	case C.valueid_type_int:
		vid.Type = ValueIDTypeInt
	case C.valueid_type_list:
		vid.Type = ValueIDTypeList
	case C.valueid_type_schedule:
		vid.Type = ValueIDTypeSchedule
	case C.valueid_type_short:
		vid.Type = ValueIDTypeShort
	case C.valueid_type_string:
		vid.Type = ValueIDTypeString
	case C.valueid_type_button:
		vid.Type = ValueIDTypeButton
	case C.valueid_type_raw:
		vid.Type = ValueIDTypeRaw
	}
	return vid
}
func (v *ValueID) IDString() string {
	return fmt.Sprintf("%d", v.ID)
}
func (v *ValueID) StringFull() string {
	return fmt.Sprintf("{Label: %s, Value: %s, Units: %q, Min: %d, Max: %d, RO: %t, WO: %t, Genre: %s, CommandClassID: %d, Instance: %d, Index: %d, Type: %s, Help: %s, HomeID: 0x%x, ID: 0x%x}",
		v.GetLabel(),
		v.GetAsString(),
		v.GetUnits(),
		v.GetMin(),
		v.GetMax(),
		v.IsReadOnly(),
		v.IsWriteOnly(),
		v.Genre,
		v.CommandClassID,
		v.Instance,
		v.Index,
		v.Type,
		v.GetHelp(),
		v.HomeID,
		v.ID)
}
func (v *ValueID) String() string {
	units := ""
	minmax := ""
	ro := ""
	wo := ""
	help := ""
	if v.GetUnits() != "" {
		units = " (" + v.GetUnits() + ")"
	}
	if v.GetMin() != 0 || v.GetMax() != 0 {
		minmax = fmt.Sprintf(" [%d -> %d]", v.GetMin(), v.GetMax())
	}
	if v.IsReadOnly() {
		ro = ", readonly"
	}
	if v.IsWriteOnly() {
		wo = ", writeonly"
	}
	if v.GetHelp() != "" {
		help = ", help: " + v.GetHelp()
	}
	return fmt.Sprintf("{%s (%s): %s%s%s%s%s, genre: %s%s}",
		v.GetLabel(),
		v.Type,
		v.GetAsString(),
		units,
		minmax,
		ro,
		wo,
		v.Genre,
		help,
	)
}
func (v *ValueID) GetLabel() string {
	return GetValueLabel(v.HomeID, v.ID)
}
func (v *ValueID) SetLabel(label string) {
	SetValueLabel(v.HomeID, v.ID, label)
}
func (v *ValueID) GetUnits() string {
	return GetValueUnits(v.HomeID, v.ID)
}
func (v *ValueID) SetUnits(units string) {
	SetValueUnits(v.HomeID, v.ID, units)
}
func (v *ValueID) GetHelp() string {
	return GetValueHelp(v.HomeID, v.ID)
}
func (v *ValueID) SetHelp(help string) {
	SetValueHelp(v.HomeID, v.ID, help)
}
func (v *ValueID) GetMin() int32 {
	return GetValueMin(v.HomeID, v.ID)
}
func (v *ValueID) GetMax() int32 {
	return GetValueMax(v.HomeID, v.ID)
}
func (v *ValueID) IsReadOnly() bool {
	return IsValueReadOnly(v.HomeID, v.ID)
}
func (v *ValueID) IsWriteOnly() bool {
	return IsValueWriteOnly(v.HomeID, v.ID)
}
func (v *ValueID) IsSet() bool {
	return IsValueSet(v.HomeID, v.ID)
}
func (v *ValueID) IsPolled() bool {
	return IsValuePolled(v.HomeID, v.ID)
}
func (v *ValueID) GetAsBool() (bool, error) {
	return GetValueAsBool(v.HomeID, v.ID)
}
func (v *ValueID) GetAsByte() (byte, error) {
	return GetValueAsByte(v.HomeID, v.ID)
}
func (v *ValueID) GetAsFloat() (float32, error) {
	return GetValueAsFloat(v.HomeID, v.ID)
}
func (v *ValueID) GetAsInt() (int32, error) {
	return GetValueAsInt(v.HomeID, v.ID)
}