// Test returns:
// - DeviceTestResult: Valid, Valid_MissingMeter, Invalid
// - error: != nil if the device is invalid and can not be configured with the provided settings
Test returns:
- DeviceTestResult: Valid, Valid_MissingMeter, Invalid
- error: != nil if the device is invalid and can not be configured with the provided settings
// Test returns : // - DeviceTestResult : Valid Valid_MissingMeter Invalid // - error : ! = nil if the device is invalid and can not be configured with the provided settings
func (d *DeviceTest) Test() (DeviceTestResult, error) {
	v, err := d.configure()
	if err != nil {
		return DeviceTestResultInvalid, err
	}
	switch DeviceCategories[d.DeviceCategory].class {
	case DeviceClassCharger:
		return d.testCharger(v)
	case DeviceClassMeter:
		return d.testMeter(d.DeviceCategory, v)
	case DeviceClassVehicle:
		return d.testVehicle(v)
	}
	return DeviceTestResultInvalid, errors.New("testDevice not implemented for this device class")
}
func ( d * DeviceTest ) Test ( ) ( DeviceTestResult , error ) { v , err := d . configure ( ) if err != nil { return DeviceTestResultInvalid , err } switch DeviceCategories [ d . DeviceCategory ] . class { case DeviceClassCharger : return d . testCharger ( v ) case DeviceClassMeter : return d . testMeter ( d . DeviceCategory , v ) case DeviceClassVehicle : return d . testVehicle ( v ) } return DeviceTestResultInvalid , errors . New ( " " ) }
Test returns:
 DeviceTestResult: Valid, Valid_MissingMeter, Invalid
 error: != nil if the device is invalid and can not be configured with the provided settings
Test returns : DeviceTestResult : Valid Valid_MissingMeter Invalid error : ! = nil if the device is invalid and can not be configured with the provided settings