diff --git a/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/DeviceProperty.java b/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/DeviceProperty.java index 688b2f14..25a63de3 100644 --- a/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/DeviceProperty.java +++ b/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/DeviceProperty.java @@ -1,197 +1,200 @@ package no.nordicsemi.android.mesh.sensorutils; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import java.util.Objects; + import no.nordicsemi.android.mesh.utils.SensorFormat; /** * Device Property */ -public enum DeviceProperty { - AVERAGE_AMBIENT_TEMPERATURE_IN_A_PERIOD_OF_DAY((short) 0x0001), - AVERAGE_INPUT_CURRENT((short) 0x0002), - AVERAGE_INPUT_VOLTAGE((short) 0x0003), - AVERAGE_OUTPUT_CURRENT((short) 0x0004), - AVERAGE_OUTPUT_VOLTAGE((short) 0x0005), - CENTER_BEAM_INTENSITY_AT_FULL_POWER((short) 0x0006), - CHROMATICITY_TOLERANCE((short) 0x0007), - COLOR_RENDERING_INDEX_R9((short) 0x0008), - COLOR_RENDERING_INDEX_RA((short) 0x0009), - DEVICE_APPEARANCE((short) 0x000A), - DEVICE_COUNTRY_OF_ORIGIN((short) 0x000B), - DEVICE_DATE_OF_MANUFACTURE((short) 0x000C), - DEVICE_ENERGY_USE_SINCE_TURN_ON((short) 0x000D), - DEVICE_FIRMWARE_REVISION((short) 0x000E), - DEVICE_GLOBAL_TRADE_ITEM_NUMBER((short) 0x000F), - DEVICE_HARDWARE_REVISION((short) 0x0010), - DEVICE_MANUFACTURER_NAME((short) 0x0011), - DEVICE_MODEL_NUMBER((short) 0x0012), - DEVICE_OPERATING_TEMPERATURE_RANGE_SPECIFICATION((short) 0x0013), - DEVICE_OPERATING_TEMPERATURE_STATISTICAL_VALUES((short) 0x0014), - DEVICE_OVER_TEMPERATURE_EVENT_STATISTICS((short) 0x0015), - DEVICE_POWER_RANGE_SPECIFICATION((short) 0x0016), - DEVICE_RUN_TIME_SINCE_TURN_ON((short) 0x0017), - DEVICE_RUNTIME_WARRANTY((short) 0x0018), - DEVICE_SERIAL_NUMBER((short) 0x0019), - DEVICE_SOFTWARE_REVISION((short) 0x001A), - DEVICE_UNDER_TEMPERATURE_EVENT_STATISTICS((short) 0x001B), - INDOOR_AMBIENT_TEMPERATURE_STATISTICAL_VALUES((short) 0x001C), - INITIAL_CIE1931_CHROMATICITY_COORDINATES((short) 0x001D), - INITIAL_CORRELATED_COLOR_TEMPERATURE((short) 0x001E), - INITIAL_LUMINOUS_FLUX((short) 0x001F), - INITIAL_PLANCKIAN_DISTANCE((short) 0x0020), - INPUT_CURRENT_RANGE_SPECIFICATION((short) 0x0021), - INPUT_CURRENT_STATISTICS((short) 0x0022), - INPUT_OVER_CURRENT_EVENT_STATISTICS((short) 0x0023), - INPUT_OVER_RIPPLE_VOLTAGE_EVENT_STATISTICS((short) 0x0024), - INPUT_OVER_VOLTAGE_EVENT_STATISTICS((short) 0x0025), - INPUT_UNDERCURRENT_EVENT_STATISTICS((short) 0x0026), - INPUT_UNDER_VOLTAGE_EVENT_STATISTICS((short) 0x0027), - INPUT_VOLTAGE_RANGE_SPECIFICATION((short) 0x0028), - INPUT_VOLTAGE_RIPPLE_SPECIFICATION((short) 0x0029), - INPUT_VOLTAGE_STATISTICS((short) 0x002A), - LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON((short) 0x002B), - LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG((short) 0x002C), - LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY((short) 0x002D), - LIGHT_CONTROL_LIGHTNESS_ON((short) 0x002E), - LIGHT_CONTROL_LIGHTNESS_PROLONG((short) 0x002F), - LIGHT_CONTROL_LIGHTNESS_STANDBY((short) 0x0030), - LIGHT_CONTROL_REGULATOR_ACCURACY((short) 0x0031), - LIGHT_CONTROL_REGULATOR_KID((short) 0x0032), - LIGHT_CONTROL_REGULATOR_KIU((short) 0x0033), - LIGHT_CONTROL_REGULATOR_KPD((short) 0x0034), - LIGHT_CONTROL_REGULATOR_KPU((short) 0x0035), - LIGHT_CONTROL_TIME_FADE((short) 0x0036), - LIGHT_CONTROL_TIME_FADE_ON((short) 0x0037), - LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO((short) 0x0038), - LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL((short) 0x0039), - LIGHT_CONTROL_TIME_OCCUPANCY_DELAY((short) 0x003A), - LIGHT_CONTROL_TIME_PROLONG((short) 0x003B), - LIGHT_CONTROL_TIME_RUN_ON((short) 0x003C), - LUMEN_MAINTENANCE_FACTOR((short) 0x003D), - LUMINOUS_EFFICACY((short) 0x003E), - LUMINOUS_ENERGY_SINCE_TURN_ON((short) 0x003F), - LUMINOUS_EXPOSURE((short) 0x0040), - LUMINOUS_FLUX_RANGE((short) 0x0041), - MOTION_SENSED((short) 0x0042), - MOTION_THRESHOLD((short) 0x0043), - OPEN_CIRCUIT_EVENT_STATISTICS((short) 0x0044), - OUTDOOR_STATISTICAL_VALUES((short) 0x0045), - OUTPUT_CURRENT_RANGE((short) 0x0046), - OUTPUT_CURRENT_STATISTICS((short) 0x0047), - OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION((short) 0x0048), - OUTPUT_VOLTAGE_RANGE((short) 0x0049), - OUTPUT_VOLTAGE_STATISTICS((short) 0x004A), - OVER_OUTPUT_RIPPLE_VOLTAGE_EVENT_STATISTICS((short) 0x004B), - PEOPLE_COUNT((short) 0x004C), - PRESENCE_DETECTED((short) 0x004D), - PRESENT_AMBIENT_LIGHT_LEVEL((short) 0x004E), - PRESENT_AMBIENT_TEMPERATURE((short) 0x004F), - PRESENT_CIE1931_CHROMATICITY_COORDINATES((short) 0x0050), - PRESENT_CORRELATED_COLOR_TEMPERATURE((short) 0x0051), - PRESENT_DEVICE_INPUT_POWER((short) 0x0052), - PRESENT_DEVICE_OPERATING_EFFICIENCY((short) 0x0053), - PRESENT_DEVICE_OPERATING_TEMPERATURE((short) 0x0054), - PRESENT_ILLUMINANCE((short) 0x0055), - PRESENT_INDOOR_AMBIENT_TEMPERATURE((short) 0x0056), - PRESENT_INPUT_CURRENT((short) 0x0057), - PRESENT_INPUT_RIPPLE_VOLTAGE((short) 0x0058), - PRESENT_INPUT_VOLTAGE((short) 0x0059), - PRESENT_LUMINOUS_FLUX((short) 0x005A), - PRESENT_OUTDOOR_AMBIENT_TEMPERATURE((short) 0x005B), - PRESENT_OUTPUT_CURRENT((short) 0x005C), - PRESENT_OUTPUT_VOLTAGE((short) 0x005D), - PRESENT_PLANCKIAN_DISTANCE((short) 0x005E), - PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE((short) 0x005F), - RELATIVE_DEVICE_ENERGY_USE_IN_A_PERIOD_OF_DAY((short) 0x0060), - RELATIVE_DEVICE_RUNTIME_IN_A_GENERIC_LEVEL_RANGE((short) 0x0061), - RELATIVE_EXPOSURE_TIME_IN_AN_ILLUMINANCE_RANGE((short) 0x0062), - RELATIVE_RUNTIME_IN_A_CORRELATED_COLOR_TEMPERATURE_RANGE((short) 0x0063), - RELATIVE_RUNTIME_IN_A_DEVICE_OPERATING_TEMPERATURE_RANGE((short) 0x0064), - RELATIVE_RUNTIME_IN_AN_INPUT_CURRENT_RANGE((short) 0x0065), - RELATIVE_RUNTIME_IN_AN_INPUT_VOLTAGE_RANGE((short) 0x0066), - SHORT_CIRCUIT_EVENT_STATISTICS((short) 0x0067), - TIME_SINCE_MOTION_SENSED((short) 0x0068), - TIME_SINCE_PRESENCE_DETECTED((short) 0x0069), - TOTAL_DEVICE_ENERGY_USE((short) 0x006A), - TOTAL_DEVICE_OFF_ON_CYCLES((short) 0x006B), - TOTAL_DEVICE_POWER_ON_CYCLES((short) 0x006C), - TOTAL_DEVICE_POWER_ON_TIME((short) 0x006D), - TOTAL_DEVICE_RUNTIME((short) 0x006E), - TOTAL_LIGHT_EXPOSURE_TIME((short) 0x006F), - TOTAL_LUMINOUS_ENERGY((short) 0x0070), - DESIRED_AMBIENT_TEMPERATURE((short) 0x0071), - PRECISE_TOTAL_DEVICE_ENERGY_USE((short) 0x0072), - POWER_FACTOR((short) 0x0073), - SENSOR_GAIN((short) 0x0074), - PRECISE_PRESENT_AMBIENT_TEMPERATURE((short) 0x0075), - PRESENT_AMBIENT_RELATIVE_HUMIDITY((short) 0x0076), - PRESENT_AMBIENT_CARBONDIOXIDE_CONCENTRATION((short) 0x0077), - PRESENT_AMBIENT_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION((short) 0x0078), - PRESENT_AMBIENT_NOISE((short) 0x0079), +public class DeviceProperty { + public final static DeviceProperty AVERAGE_AMBIENT_TEMPERATURE_IN_A_PERIOD_OF_DAY = new DeviceProperty((short) 0x0001); + public final static DeviceProperty AVERAGE_INPUT_CURRENT = new DeviceProperty((short) 0x0002); + public final static DeviceProperty AVERAGE_INPUT_VOLTAGE = new DeviceProperty((short) 0x0003); + public final static DeviceProperty AVERAGE_OUTPUT_CURRENT = new DeviceProperty((short) 0x0004); + public final static DeviceProperty AVERAGE_OUTPUT_VOLTAGE = new DeviceProperty((short) 0x0005); + public final static DeviceProperty CENTER_BEAM_INTENSITY_AT_FULL_POWER = new DeviceProperty((short) 0x0006); + public final static DeviceProperty CHROMATICITY_TOLERANCE = new DeviceProperty((short) 0x0007); + public final static DeviceProperty COLOR_RENDERING_INDEX_R9 = new DeviceProperty((short) 0x0008); + public final static DeviceProperty COLOR_RENDERING_INDEX_RA = new DeviceProperty((short) 0x0009); + public final static DeviceProperty DEVICE_APPEARANCE = new DeviceProperty((short) 0x000A); + public final static DeviceProperty DEVICE_COUNTRY_OF_ORIGIN = new DeviceProperty((short) 0x000B); + public final static DeviceProperty DEVICE_DATE_OF_MANUFACTURE = new DeviceProperty((short) 0x000C); + public final static DeviceProperty DEVICE_ENERGY_USE_SINCE_TURN_ON = new DeviceProperty((short) 0x000D); + public final static DeviceProperty DEVICE_FIRMWARE_REVISION = new DeviceProperty((short) 0x000E); + public final static DeviceProperty DEVICE_GLOBAL_TRADE_ITEM_NUMBER = new DeviceProperty((short) 0x000F); + public final static DeviceProperty DEVICE_HARDWARE_REVISION = new DeviceProperty((short) 0x0010); + public final static DeviceProperty DEVICE_MANUFACTURER_NAME = new DeviceProperty((short) 0x0011); + public final static DeviceProperty DEVICE_MODEL_NUMBER = new DeviceProperty((short) 0x0012); + public final static DeviceProperty DEVICE_OPERATING_TEMPERATURE_RANGE_SPECIFICATION = new DeviceProperty((short) 0x0013); + public final static DeviceProperty DEVICE_OPERATING_TEMPERATURE_STATISTICAL_VALUES = new DeviceProperty((short) 0x0014); + public final static DeviceProperty DEVICE_OVER_TEMPERATURE_EVENT_STATISTICS = new DeviceProperty((short) 0x0015); + public final static DeviceProperty DEVICE_POWER_RANGE_SPECIFICATION = new DeviceProperty((short) 0x0016); + public final static DeviceProperty DEVICE_RUN_TIME_SINCE_TURN_ON = new DeviceProperty((short) 0x0017); + public final static DeviceProperty DEVICE_RUNTIME_WARRANTY = new DeviceProperty((short) 0x0018); + public final static DeviceProperty DEVICE_SERIAL_NUMBER = new DeviceProperty((short) 0x0019); + public final static DeviceProperty DEVICE_SOFTWARE_REVISION = new DeviceProperty((short) 0x001A); + public final static DeviceProperty DEVICE_UNDER_TEMPERATURE_EVENT_STATISTICS = new DeviceProperty((short) 0x001B); + public final static DeviceProperty INDOOR_AMBIENT_TEMPERATURE_STATISTICAL_VALUES = new DeviceProperty((short) 0x001C); + public final static DeviceProperty INITIAL_CIE1931_CHROMATICITY_COORDINATES = new DeviceProperty((short) 0x001D); + public final static DeviceProperty INITIAL_CORRELATED_COLOR_TEMPERATURE = new DeviceProperty((short) 0x001E); + public final static DeviceProperty INITIAL_LUMINOUS_FLUX = new DeviceProperty((short) 0x001F); + public final static DeviceProperty INITIAL_PLANCKIAN_DISTANCE = new DeviceProperty((short) 0x0020); + public final static DeviceProperty INPUT_CURRENT_RANGE_SPECIFICATION = new DeviceProperty((short) 0x0021); + public final static DeviceProperty INPUT_CURRENT_STATISTICS = new DeviceProperty((short) 0x0022); + public final static DeviceProperty INPUT_OVER_CURRENT_EVENT_STATISTICS = new DeviceProperty((short) 0x0023); + public final static DeviceProperty INPUT_OVER_RIPPLE_VOLTAGE_EVENT_STATISTICS = new DeviceProperty((short) 0x0024); + public final static DeviceProperty INPUT_OVER_VOLTAGE_EVENT_STATISTICS = new DeviceProperty((short) 0x0025); + public final static DeviceProperty INPUT_UNDERCURRENT_EVENT_STATISTICS = new DeviceProperty((short) 0x0026); + public final static DeviceProperty INPUT_UNDER_VOLTAGE_EVENT_STATISTICS = new DeviceProperty((short) 0x0027); + public final static DeviceProperty INPUT_VOLTAGE_RANGE_SPECIFICATION = new DeviceProperty((short) 0x0028); + public final static DeviceProperty INPUT_VOLTAGE_RIPPLE_SPECIFICATION = new DeviceProperty((short) 0x0029); + public final static DeviceProperty INPUT_VOLTAGE_STATISTICS = new DeviceProperty((short) 0x002A); + public final static DeviceProperty LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON = new DeviceProperty((short) 0x002B); + public final static DeviceProperty LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG = new DeviceProperty((short) 0x002C); + public final static DeviceProperty LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY = new DeviceProperty((short) 0x002D); + public final static DeviceProperty LIGHT_CONTROL_LIGHTNESS_ON = new DeviceProperty((short) 0x002E); + public final static DeviceProperty LIGHT_CONTROL_LIGHTNESS_PROLONG = new DeviceProperty((short) 0x002F); + public final static DeviceProperty LIGHT_CONTROL_LIGHTNESS_STANDBY = new DeviceProperty((short) 0x0030); + public final static DeviceProperty LIGHT_CONTROL_REGULATOR_ACCURACY = new DeviceProperty((short) 0x0031); + public final static DeviceProperty LIGHT_CONTROL_REGULATOR_KID = new DeviceProperty((short) 0x0032); + public final static DeviceProperty LIGHT_CONTROL_REGULATOR_KIU = new DeviceProperty((short) 0x0033); + public final static DeviceProperty LIGHT_CONTROL_REGULATOR_KPD = new DeviceProperty((short) 0x0034); + public final static DeviceProperty LIGHT_CONTROL_REGULATOR_KPU = new DeviceProperty((short) 0x0035); + public final static DeviceProperty LIGHT_CONTROL_TIME_FADE = new DeviceProperty((short) 0x0036); + public final static DeviceProperty LIGHT_CONTROL_TIME_FADE_ON = new DeviceProperty((short) 0x0037); + public final static DeviceProperty LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO = new DeviceProperty((short) 0x0038); + public final static DeviceProperty LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL = new DeviceProperty((short) 0x0039); + public final static DeviceProperty LIGHT_CONTROL_TIME_OCCUPANCY_DELAY = new DeviceProperty((short) 0x003A); + public final static DeviceProperty LIGHT_CONTROL_TIME_PROLONG = new DeviceProperty((short) 0x003B); + public final static DeviceProperty LIGHT_CONTROL_TIME_RUN_ON = new DeviceProperty((short) 0x003C); + public final static DeviceProperty LUMEN_MAINTENANCE_FACTOR = new DeviceProperty((short) 0x003D); + public final static DeviceProperty LUMINOUS_EFFICACY = new DeviceProperty((short) 0x003E); + public final static DeviceProperty LUMINOUS_ENERGY_SINCE_TURN_ON = new DeviceProperty((short) 0x003F); + public final static DeviceProperty LUMINOUS_EXPOSURE = new DeviceProperty((short) 0x0040); + public final static DeviceProperty LUMINOUS_FLUX_RANGE = new DeviceProperty((short) 0x0041); + public final static DeviceProperty MOTION_SENSED = new DeviceProperty((short) 0x0042); + public final static DeviceProperty MOTION_THRESHOLD = new DeviceProperty((short) 0x0043); + public final static DeviceProperty OPEN_CIRCUIT_EVENT_STATISTICS = new DeviceProperty((short) 0x0044); + public final static DeviceProperty OUTDOOR_STATISTICAL_VALUES = new DeviceProperty((short) 0x0045); + public final static DeviceProperty OUTPUT_CURRENT_RANGE = new DeviceProperty((short) 0x0046); + public final static DeviceProperty OUTPUT_CURRENT_STATISTICS = new DeviceProperty((short) 0x0047); + public final static DeviceProperty OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION = new DeviceProperty((short) 0x0048); + public final static DeviceProperty OUTPUT_VOLTAGE_RANGE = new DeviceProperty((short) 0x0049); + public final static DeviceProperty OUTPUT_VOLTAGE_STATISTICS = new DeviceProperty((short) 0x004A); + public final static DeviceProperty OVER_OUTPUT_RIPPLE_VOLTAGE_EVENT_STATISTICS = new DeviceProperty((short) 0x004B); + public final static DeviceProperty PEOPLE_COUNT = new DeviceProperty((short) 0x004C); + public final static DeviceProperty PRESENCE_DETECTED = new DeviceProperty((short) 0x004D); + public final static DeviceProperty PRESENT_AMBIENT_LIGHT_LEVEL = new DeviceProperty((short) 0x004E); + public final static DeviceProperty PRESENT_AMBIENT_TEMPERATURE = new DeviceProperty((short) 0x004F); + public final static DeviceProperty PRESENT_CIE1931_CHROMATICITY_COORDINATES = new DeviceProperty((short) 0x0050); + public final static DeviceProperty PRESENT_CORRELATED_COLOR_TEMPERATURE = new DeviceProperty((short) 0x0051); + public final static DeviceProperty PRESENT_DEVICE_INPUT_POWER = new DeviceProperty((short) 0x0052); + public final static DeviceProperty PRESENT_DEVICE_OPERATING_EFFICIENCY = new DeviceProperty((short) 0x0053); + public final static DeviceProperty PRESENT_DEVICE_OPERATING_TEMPERATURE = new DeviceProperty((short) 0x0054); + public final static DeviceProperty PRESENT_ILLUMINANCE = new DeviceProperty((short) 0x0055); + public final static DeviceProperty PRESENT_INDOOR_AMBIENT_TEMPERATURE = new DeviceProperty((short) 0x0056); + public final static DeviceProperty PRESENT_INPUT_CURRENT = new DeviceProperty((short) 0x0057); + public final static DeviceProperty PRESENT_INPUT_RIPPLE_VOLTAGE = new DeviceProperty((short) 0x0058); + public final static DeviceProperty PRESENT_INPUT_VOLTAGE = new DeviceProperty((short) 0x0059); + public final static DeviceProperty PRESENT_LUMINOUS_FLUX = new DeviceProperty((short) 0x005A); + public final static DeviceProperty PRESENT_OUTDOOR_AMBIENT_TEMPERATURE = new DeviceProperty((short) 0x005B); + public final static DeviceProperty PRESENT_OUTPUT_CURRENT = new DeviceProperty((short) 0x005C); + public final static DeviceProperty PRESENT_OUTPUT_VOLTAGE = new DeviceProperty((short) 0x005D); + public final static DeviceProperty PRESENT_PLANCKIAN_DISTANCE = new DeviceProperty((short) 0x005E); + public final static DeviceProperty PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE = new DeviceProperty((short) 0x005F); + public final static DeviceProperty RELATIVE_DEVICE_ENERGY_USE_IN_A_PERIOD_OF_DAY = new DeviceProperty((short) 0x0060); + public final static DeviceProperty RELATIVE_DEVICE_RUNTIME_IN_A_GENERIC_LEVEL_RANGE = new DeviceProperty((short) 0x0061); + public final static DeviceProperty RELATIVE_EXPOSURE_TIME_IN_AN_ILLUMINANCE_RANGE = new DeviceProperty((short) 0x0062); + public final static DeviceProperty RELATIVE_RUNTIME_IN_A_CORRELATED_COLOR_TEMPERATURE_RANGE = new DeviceProperty((short) 0x0063); + public final static DeviceProperty RELATIVE_RUNTIME_IN_A_DEVICE_OPERATING_TEMPERATURE_RANGE = new DeviceProperty((short) 0x0064); + public final static DeviceProperty RELATIVE_RUNTIME_IN_AN_INPUT_CURRENT_RANGE = new DeviceProperty((short) 0x0065); + public final static DeviceProperty RELATIVE_RUNTIME_IN_AN_INPUT_VOLTAGE_RANGE = new DeviceProperty((short) 0x0066); + public final static DeviceProperty SHORT_CIRCUIT_EVENT_STATISTICS = new DeviceProperty((short) 0x0067); + public final static DeviceProperty TIME_SINCE_MOTION_SENSED = new DeviceProperty((short) 0x0068); + public final static DeviceProperty TIME_SINCE_PRESENCE_DETECTED = new DeviceProperty((short) 0x0069); + public final static DeviceProperty TOTAL_DEVICE_ENERGY_USE = new DeviceProperty((short) 0x006A); + public final static DeviceProperty TOTAL_DEVICE_OFF_ON_CYCLES = new DeviceProperty((short) 0x006B); + public final static DeviceProperty TOTAL_DEVICE_POWER_ON_CYCLES = new DeviceProperty((short) 0x006C); + public final static DeviceProperty TOTAL_DEVICE_POWER_ON_TIME = new DeviceProperty((short) 0x006D); + public final static DeviceProperty TOTAL_DEVICE_RUNTIME = new DeviceProperty((short) 0x006E); + public final static DeviceProperty TOTAL_LIGHT_EXPOSURE_TIME = new DeviceProperty((short) 0x006F); + public final static DeviceProperty TOTAL_LUMINOUS_ENERGY = new DeviceProperty((short) 0x0070); + public final static DeviceProperty DESIRED_AMBIENT_TEMPERATURE = new DeviceProperty((short) 0x0071); + public final static DeviceProperty PRECISE_TOTAL_DEVICE_ENERGY_USE = new DeviceProperty((short) 0x0072); + public final static DeviceProperty POWER_FACTOR = new DeviceProperty((short) 0x0073); + public final static DeviceProperty SENSOR_GAIN = new DeviceProperty((short) 0x0074); + public final static DeviceProperty PRECISE_PRESENT_AMBIENT_TEMPERATURE = new DeviceProperty((short) 0x0075); + public final static DeviceProperty PRESENT_AMBIENT_RELATIVE_HUMIDITY = new DeviceProperty((short) 0x0076); + public final static DeviceProperty PRESENT_AMBIENT_CARBONDIOXIDE_CONCENTRATION = new DeviceProperty((short) 0x0077); + public final static DeviceProperty PRESENT_AMBIENT_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION = new DeviceProperty((short) 0x0078); + public final static DeviceProperty PRESENT_AMBIENT_NOISE = new DeviceProperty((short) 0x0079); // These are undefined in mesh device properties v2 = (short) 0x007A // These are undefined in mesh device properties v2 = (short) 0x007B // These are undefined in mesh device properties v2 = (short) 0x007C // These are undefined in mesh device properties v2 = (short) 0x007D // These are undefined in mesh device properties v2 = (short) 0x007E // These are undefined in mesh device properties v2 = (short) 0x007F - ACTIVE_ENERGY_LOAD_SIDE((short) 0x0080), - ACTIVE_POWER_LOAD_SIDE((short) 0x0081), - AIR_PRESSURE((short) 0x0082), - APPARENT_ENERGY((short) 0x0083), - APPARENT_POWER((short) 0x0084), - APPARENT_WIND_DIRECTION((short) 0x0085), - APPARENT_WIND_SPEED((short) 0x0086), - DEW_POINT((short) 0x0087), - EXTERNAL_SUPPLY_VOLTAGE((short) 0x0088), - EXTERNAL_SUPPLY_VOLTAGE_FREQUENCY((short) 0x0089), - GUST_FACTOR((short) 0x008A), - HEAT_INDEX((short) 0x008B), - LIGHT_DISTRIBUTION((short) 0x008C), - LIGHT_SOURCE_CURRENT((short) 0x008D), - LIGHT_SOURCE_ON_TIME_NOT_RESETTABLE((short) 0x008E), - LIGHT_SOURCE_ON_TIME_RESETTABLE((short) 0x008F), - LIGHT_SOURCE_OPEN_CIRCUIT_STATISTICS((short) 0x0090), - LIGHT_SOURCE_OVERALL_FAILURES_STATISTICS((short) 0x0091), - LIGHT_SOURCE_SHORT_CIRCUIT_STATISTICS((short) 0x0092), - LIGHT_SOURCE_START_COUNTER_RESETTABLE((short) 0x0093), - LIGHT_SOURCE_TEMPERATURE((short) 0x0094), - LIGHT_SOURCE_THERMAL_DERATING_STATISTICS((short) 0x0095), - LIGHT_SOURCE_THERMAL_SHUTDOWN_STATISTICS((short) 0x0096), - LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES((short) 0x0097), - LIGHT_SOURCE_VOLTAGE((short) 0x0098), - LUMINAIRE_COLOR((short) 0x0099), - LUMINAIRE_IDENTIFICATION_NUMBER((short) 0x009A), - LUMINAIRE_MANUFACTURER_GTIN((short) 0x009B), - LUMINAIRE_NOMINAL_INPUT_POWER((short) 0x009C), - LUMINAIRE_NOMINAL_MAXIMUM_AC_MAINS_VOLTAGE((short) 0x009D), - LUMINAIRE_NOMINAL_MINIMUM_AC_MAINS_VOLTAGE((short) 0x009E), - LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL((short) 0x009F), - LUMINAIRE_TIME_OF_MANUFACTURE((short) 0x00A0), - MAGNETIC_DECLINATION((short) 0x00A1), - MAGNETIC_FLUX_DENSITY_2D((short) 0x00A2), - MAGNETIC_FLUX_DENSITY_3D((short) 0x00A3), - NOMINAL_LIGHT_OUTPUT((short) 0x00A4), - OVERALL_FAILURE_CONDITION((short) 0x00A5), - POLLEN_CONCENTRATION((short) 0x00A6), - PRESENT_INDOOR_RELATIVE_HUMIDITY((short) 0x00A7), - PRESENT_OUTDOOR_RELATIVE_HUMIDITY((short) 0x00A8), - PRESSURE((short) 0x00A9), - RAINFALL((short) 0x00AA), - RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE((short) 0x00AB), - RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS((short) 0x00AC), - REFERENCE_TEMPERATURE((short) 0x00AD), - TOTAL_DEVICE_STARTS((short) 0x00AE), - TRUE_WIND_DIRECTION((short) 0x00AF), - TRUE_WIND_SPEED((short) 0x00B0), - UV_INDEX((short) 0x00B1), - WIND_CHILL((short) 0x00B2), - LIGHT_SOURCE_TYPE((short) 0x00B3), - LUMINAIRE_IDENTIFICATION_STRING((short) 0x00B4), - OUTPUT_POWER_LIMITATION((short) 0x00B5), - THERMAL_DERATING((short) 0x00B6), - OUTPUT_CURRENT_PERCENT((short) 0x00B7), - UNKNOWN((short) 0xFFFF); + public final static DeviceProperty ACTIVE_ENERGY_LOAD_SIDE = new DeviceProperty((short) 0x0080); + public final static DeviceProperty ACTIVE_POWER_LOAD_SIDE = new DeviceProperty((short) 0x0081); + public final static DeviceProperty AIR_PRESSURE = new DeviceProperty((short) 0x0082); + public final static DeviceProperty APPARENT_ENERGY = new DeviceProperty((short) 0x0083); + public final static DeviceProperty APPARENT_POWER = new DeviceProperty((short) 0x0084); + public final static DeviceProperty APPARENT_WIND_DIRECTION = new DeviceProperty((short) 0x0085); + public final static DeviceProperty APPARENT_WIND_SPEED = new DeviceProperty((short) 0x0086); + public final static DeviceProperty DEW_POINT = new DeviceProperty((short) 0x0087); + public final static DeviceProperty EXTERNAL_SUPPLY_VOLTAGE = new DeviceProperty((short) 0x0088); + public final static DeviceProperty EXTERNAL_SUPPLY_VOLTAGE_FREQUENCY = new DeviceProperty((short) 0x0089); + public final static DeviceProperty GUST_FACTOR = new DeviceProperty((short) 0x008A); + public final static DeviceProperty HEAT_INDEX = new DeviceProperty((short) 0x008B); + public final static DeviceProperty LIGHT_DISTRIBUTION = new DeviceProperty((short) 0x008C); + public final static DeviceProperty LIGHT_SOURCE_CURRENT = new DeviceProperty((short) 0x008D); + public final static DeviceProperty LIGHT_SOURCE_ON_TIME_NOT_RESETTABLE = new DeviceProperty((short) 0x008E); + public final static DeviceProperty LIGHT_SOURCE_ON_TIME_RESETTABLE = new DeviceProperty((short) 0x008F); + public final static DeviceProperty LIGHT_SOURCE_OPEN_CIRCUIT_STATISTICS = new DeviceProperty((short) 0x0090); + public final static DeviceProperty LIGHT_SOURCE_OVERALL_FAILURES_STATISTICS = new DeviceProperty((short) 0x0091); + public final static DeviceProperty LIGHT_SOURCE_SHORT_CIRCUIT_STATISTICS = new DeviceProperty((short) 0x0092); + public final static DeviceProperty LIGHT_SOURCE_START_COUNTER_RESETTABLE = new DeviceProperty((short) 0x0093); + public final static DeviceProperty LIGHT_SOURCE_TEMPERATURE = new DeviceProperty((short) 0x0094); + public final static DeviceProperty LIGHT_SOURCE_THERMAL_DERATING_STATISTICS = new DeviceProperty((short) 0x0095); + public final static DeviceProperty LIGHT_SOURCE_THERMAL_SHUTDOWN_STATISTICS = new DeviceProperty((short) 0x0096); + public final static DeviceProperty LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES = new DeviceProperty((short) 0x0097); + public final static DeviceProperty LIGHT_SOURCE_VOLTAGE = new DeviceProperty((short) 0x0098); + public final static DeviceProperty LUMINAIRE_COLOR = new DeviceProperty((short) 0x0099); + public final static DeviceProperty LUMINAIRE_IDENTIFICATION_NUMBER = new DeviceProperty((short) 0x009A); + public final static DeviceProperty LUMINAIRE_MANUFACTURER_GTIN = new DeviceProperty((short) 0x009B); + public final static DeviceProperty LUMINAIRE_NOMINAL_INPUT_POWER = new DeviceProperty((short) 0x009C); + public final static DeviceProperty LUMINAIRE_NOMINAL_MAXIMUM_AC_MAINS_VOLTAGE = new DeviceProperty((short) 0x009D); + public final static DeviceProperty LUMINAIRE_NOMINAL_MINIMUM_AC_MAINS_VOLTAGE = new DeviceProperty((short) 0x009E); + public final static DeviceProperty LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL = new DeviceProperty((short) 0x009F); + public final static DeviceProperty LUMINAIRE_TIME_OF_MANUFACTURE = new DeviceProperty((short) 0x00A0); + public final static DeviceProperty MAGNETIC_DECLINATION = new DeviceProperty((short) 0x00A1); + public final static DeviceProperty MAGNETIC_FLUX_DENSITY_2D = new DeviceProperty((short) 0x00A2); + public final static DeviceProperty MAGNETIC_FLUX_DENSITY_3D = new DeviceProperty((short) 0x00A3); + public final static DeviceProperty NOMINAL_LIGHT_OUTPUT = new DeviceProperty((short) 0x00A4); + public final static DeviceProperty OVERALL_FAILURE_CONDITION = new DeviceProperty((short) 0x00A5); + public final static DeviceProperty POLLEN_CONCENTRATION = new DeviceProperty((short) 0x00A6); + public final static DeviceProperty PRESENT_INDOOR_RELATIVE_HUMIDITY = new DeviceProperty((short) 0x00A7); + public final static DeviceProperty PRESENT_OUTDOOR_RELATIVE_HUMIDITY = new DeviceProperty((short) 0x00A8); + public final static DeviceProperty PRESSURE = new DeviceProperty((short) 0x00A9); + public final static DeviceProperty RAINFALL = new DeviceProperty((short) 0x00AA); + public final static DeviceProperty RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE = new DeviceProperty((short) 0x00AB); + public final static DeviceProperty RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS = new DeviceProperty((short) 0x00AC); + public final static DeviceProperty REFERENCE_TEMPERATURE = new DeviceProperty((short) 0x00AD); + public final static DeviceProperty TOTAL_DEVICE_STARTS = new DeviceProperty((short) 0x00AE); + public final static DeviceProperty TRUE_WIND_DIRECTION = new DeviceProperty((short) 0x00AF); + public final static DeviceProperty TRUE_WIND_SPEED = new DeviceProperty((short) 0x00B0); + public final static DeviceProperty UV_INDEX = new DeviceProperty((short) 0x00B1); + public final static DeviceProperty WIND_CHILL = new DeviceProperty((short) 0x00B2); + public final static DeviceProperty LIGHT_SOURCE_TYPE = new DeviceProperty((short) 0x00B3); + public final static DeviceProperty LUMINAIRE_IDENTIFICATION_STRING = new DeviceProperty((short) 0x00B4); + public final static DeviceProperty OUTPUT_POWER_LIMITATION = new DeviceProperty((short) 0x00B5); + public final static DeviceProperty THERMAL_DERATING = new DeviceProperty((short) 0x00B6); + public final static DeviceProperty OUTPUT_CURRENT_PERCENT = new DeviceProperty((short) 0x00B7); private final short propertyId; @@ -199,759 +202,392 @@ public enum DeviceProperty { this.propertyId = property; } - /** - * Returns the static oob type value - */ public short getPropertyId() { - return propertyId; + return this.propertyId; } - /** - * Returns the Device Property for a given property id. - * - * @param propertyId property id - */ - public static DeviceProperty from(final short propertyId) { - switch (propertyId) { - case 0x0001: - return AVERAGE_AMBIENT_TEMPERATURE_IN_A_PERIOD_OF_DAY; - case 0x0002: - return AVERAGE_INPUT_CURRENT; - case 0x0003: - return AVERAGE_INPUT_VOLTAGE; - case 0x0004: - return AVERAGE_OUTPUT_CURRENT; - case 0x0005: - return AVERAGE_OUTPUT_VOLTAGE; - case 0x0006: - return CENTER_BEAM_INTENSITY_AT_FULL_POWER; - case 0x0007: - return CHROMATICITY_TOLERANCE; - case 0x0008: - return COLOR_RENDERING_INDEX_R9; - case 0x0009: - return COLOR_RENDERING_INDEX_RA; - case 0x000A: - return DEVICE_APPEARANCE; - case 0x000B: - return DEVICE_COUNTRY_OF_ORIGIN; - case 0x000C: - return DEVICE_DATE_OF_MANUFACTURE; - case 0x000D: - return DEVICE_ENERGY_USE_SINCE_TURN_ON; - case 0x000E: - return DEVICE_FIRMWARE_REVISION; - case 0x000F: - return DEVICE_GLOBAL_TRADE_ITEM_NUMBER; - case 0x0010: - return DEVICE_HARDWARE_REVISION; - case 0x0011: - return DEVICE_MANUFACTURER_NAME; - case 0x0012: - return DEVICE_MODEL_NUMBER; - case 0x0013: - return DEVICE_OPERATING_TEMPERATURE_RANGE_SPECIFICATION; - case 0x0014: - return DEVICE_OPERATING_TEMPERATURE_STATISTICAL_VALUES; - case 0x0015: - return DEVICE_OVER_TEMPERATURE_EVENT_STATISTICS; - case 0x0016: - return DEVICE_POWER_RANGE_SPECIFICATION; - case 0x0017: - return DEVICE_RUN_TIME_SINCE_TURN_ON; - case 0x0018: - return DEVICE_RUNTIME_WARRANTY; - case 0x0019: - return DEVICE_SERIAL_NUMBER; - case 0x001A: - return DEVICE_SOFTWARE_REVISION; - case 0x001B: - return DEVICE_UNDER_TEMPERATURE_EVENT_STATISTICS; - case 0x001C: - return INDOOR_AMBIENT_TEMPERATURE_STATISTICAL_VALUES; - case 0x001D: - return INITIAL_CIE1931_CHROMATICITY_COORDINATES; - case 0x001E: - return INITIAL_CORRELATED_COLOR_TEMPERATURE; - case 0x001F: - return INITIAL_LUMINOUS_FLUX; - case 0x0020: - return INITIAL_PLANCKIAN_DISTANCE; - case 0x0021: - return INPUT_CURRENT_RANGE_SPECIFICATION; - case 0x0022: - return INPUT_CURRENT_STATISTICS; - case 0x0023: - return INPUT_OVER_CURRENT_EVENT_STATISTICS; - case 0x0024: - return INPUT_OVER_RIPPLE_VOLTAGE_EVENT_STATISTICS; - case 0x0025: - return INPUT_OVER_VOLTAGE_EVENT_STATISTICS; - case 0x0026: - return INPUT_UNDERCURRENT_EVENT_STATISTICS; - case 0x0027: - return INPUT_UNDER_VOLTAGE_EVENT_STATISTICS; - case 0x0028: - return INPUT_VOLTAGE_RANGE_SPECIFICATION; - case 0x0029: - return INPUT_VOLTAGE_RIPPLE_SPECIFICATION; - case 0x002A: - return INPUT_VOLTAGE_STATISTICS; - case 0x002B: - return LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON; - case 0x002C: - return LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG; - case 0x002D: - return LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY; - case 0x002E: - return LIGHT_CONTROL_LIGHTNESS_ON; - case 0x002F: - return LIGHT_CONTROL_LIGHTNESS_PROLONG; - case 0x0030: - return LIGHT_CONTROL_LIGHTNESS_STANDBY; - case 0x0031: - return LIGHT_CONTROL_REGULATOR_ACCURACY; - case 0x0032: - return LIGHT_CONTROL_REGULATOR_KID; - case 0x0033: - return LIGHT_CONTROL_REGULATOR_KIU; - case 0x0034: - return LIGHT_CONTROL_REGULATOR_KPD; - case 0x0035: - return LIGHT_CONTROL_REGULATOR_KPU; - case 0x0036: - return LIGHT_CONTROL_TIME_FADE; - case 0x0037: - return LIGHT_CONTROL_TIME_FADE_ON; - case 0x0038: - return LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO; - case 0x0039: - return LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL; - case 0x003A: - return LIGHT_CONTROL_TIME_OCCUPANCY_DELAY; - case 0x003B: - return LIGHT_CONTROL_TIME_PROLONG; - case 0x003C: - return LIGHT_CONTROL_TIME_RUN_ON; - case 0x003D: - return LUMEN_MAINTENANCE_FACTOR; - case 0x003E: - return LUMINOUS_EFFICACY; - case 0x003F: - return LUMINOUS_ENERGY_SINCE_TURN_ON; - case 0x0040: - return LUMINOUS_EXPOSURE; - case 0x0041: - return LUMINOUS_FLUX_RANGE; - case 0x0042: - return MOTION_SENSED; - case 0x0043: - return MOTION_THRESHOLD; - case 0x0044: - return OPEN_CIRCUIT_EVENT_STATISTICS; - case 0x0045: - return OUTDOOR_STATISTICAL_VALUES; - case 0x0046: - return OUTPUT_CURRENT_RANGE; - case 0x0047: - return OUTPUT_CURRENT_STATISTICS; - case 0x0048: - return OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION; - case 0x0049: - return OUTPUT_VOLTAGE_RANGE; - case 0x004A: - return OUTPUT_VOLTAGE_STATISTICS; - case 0x004B: - return OVER_OUTPUT_RIPPLE_VOLTAGE_EVENT_STATISTICS; - case 0x004C: - return PEOPLE_COUNT; - case 0x004D: - return PRESENCE_DETECTED; - case 0x004E: - return PRESENT_AMBIENT_LIGHT_LEVEL; - case 0x004F: - return PRESENT_AMBIENT_TEMPERATURE; - case 0x0050: - return PRESENT_CIE1931_CHROMATICITY_COORDINATES; - case 0x0051: - return PRESENT_CORRELATED_COLOR_TEMPERATURE; - case 0x0052: - return PRESENT_DEVICE_INPUT_POWER; - case 0x0053: - return PRESENT_DEVICE_OPERATING_EFFICIENCY; - case 0x0054: - return PRESENT_DEVICE_OPERATING_TEMPERATURE; - case 0x0055: - return PRESENT_ILLUMINANCE; - case 0x0056: - return PRESENT_INDOOR_AMBIENT_TEMPERATURE; - case 0x0057: - return PRESENT_INPUT_CURRENT; - case 0x0058: - return PRESENT_INPUT_RIPPLE_VOLTAGE; - case 0x0059: - return PRESENT_INPUT_VOLTAGE; - case 0x005A: - return PRESENT_LUMINOUS_FLUX; - case 0x005B: - return PRESENT_OUTDOOR_AMBIENT_TEMPERATURE; - case 0x005C: - return PRESENT_OUTPUT_CURRENT; - case 0x005D: - return PRESENT_OUTPUT_VOLTAGE; - case 0x005E: - return PRESENT_PLANCKIAN_DISTANCE; - case 0x005F: - return PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE; - case 0x0060: - return RELATIVE_DEVICE_ENERGY_USE_IN_A_PERIOD_OF_DAY; - case 0x0061: - return RELATIVE_DEVICE_RUNTIME_IN_A_GENERIC_LEVEL_RANGE; - case 0x0062: - return RELATIVE_EXPOSURE_TIME_IN_AN_ILLUMINANCE_RANGE; - case 0x0063: - return RELATIVE_RUNTIME_IN_A_CORRELATED_COLOR_TEMPERATURE_RANGE; - case 0x0064: - return RELATIVE_RUNTIME_IN_A_DEVICE_OPERATING_TEMPERATURE_RANGE; - case 0x0065: - return RELATIVE_RUNTIME_IN_AN_INPUT_CURRENT_RANGE; - case 0x0066: - return RELATIVE_RUNTIME_IN_AN_INPUT_VOLTAGE_RANGE; - case 0x0067: - return SHORT_CIRCUIT_EVENT_STATISTICS; - case 0x0068: - return TIME_SINCE_MOTION_SENSED; - case 0x0069: - return TIME_SINCE_PRESENCE_DETECTED; - case 0x006A: - return TOTAL_DEVICE_ENERGY_USE; - case 0x006B: - return TOTAL_DEVICE_OFF_ON_CYCLES; - case 0x006C: - return TOTAL_DEVICE_POWER_ON_CYCLES; - case 0x006D: - return TOTAL_DEVICE_POWER_ON_TIME; - case 0x006E: - return TOTAL_DEVICE_RUNTIME; - case 0x006F: - return TOTAL_LIGHT_EXPOSURE_TIME; - case 0x0070: - return TOTAL_LUMINOUS_ENERGY; - case 0x0071: - return DESIRED_AMBIENT_TEMPERATURE; - case 0x0072: - return PRECISE_TOTAL_DEVICE_ENERGY_USE; - case 0x0073: - return POWER_FACTOR; - case 0x0074: - return SENSOR_GAIN; - case 0x0075: - return PRECISE_PRESENT_AMBIENT_TEMPERATURE; - case 0x0076: - return PRESENT_AMBIENT_RELATIVE_HUMIDITY; - case 0x0077: - return PRESENT_AMBIENT_CARBONDIOXIDE_CONCENTRATION; - case 0x0078: - return PRESENT_AMBIENT_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION; - case 0x0079: - return PRESENT_AMBIENT_NOISE; - case 0x0080: - return ACTIVE_ENERGY_LOAD_SIDE; - case 0x0081: - return ACTIVE_POWER_LOAD_SIDE; - case 0x0082: - return AIR_PRESSURE; - case 0x0083: - return APPARENT_ENERGY; - case 0x0084: - return APPARENT_POWER; - case 0x0085: - return APPARENT_WIND_DIRECTION; - case 0x0086: - return APPARENT_WIND_SPEED; - case 0x0087: - return DEW_POINT; - case 0x0088: - return EXTERNAL_SUPPLY_VOLTAGE; - case 0x0089: - return EXTERNAL_SUPPLY_VOLTAGE_FREQUENCY; - case 0x008A: - return GUST_FACTOR; - case 0x008B: - return HEAT_INDEX; - case 0x008C: - return LIGHT_DISTRIBUTION; - case 0x008D: - return LIGHT_SOURCE_CURRENT; - case 0x008E: - return LIGHT_SOURCE_ON_TIME_NOT_RESETTABLE; - case 0x008F: - return LIGHT_SOURCE_ON_TIME_RESETTABLE; - case 0x0090: - return LIGHT_SOURCE_OPEN_CIRCUIT_STATISTICS; - case 0x0091: - return LIGHT_SOURCE_OVERALL_FAILURES_STATISTICS; - case 0x0092: - return LIGHT_SOURCE_SHORT_CIRCUIT_STATISTICS; - case 0x0093: - return LIGHT_SOURCE_START_COUNTER_RESETTABLE; - case 0x0094: - return LIGHT_SOURCE_TEMPERATURE; - case 0x0095: - return LIGHT_SOURCE_THERMAL_DERATING_STATISTICS; - case 0x0096: - return LIGHT_SOURCE_THERMAL_SHUTDOWN_STATISTICS; - case 0x0097: - return LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES; - case 0x0098: - return LIGHT_SOURCE_VOLTAGE; - case 0x0099: - return LUMINAIRE_COLOR; - case 0x009A: - return LUMINAIRE_IDENTIFICATION_NUMBER; - case 0x009B: - return LUMINAIRE_MANUFACTURER_GTIN; - case 0x009C: - return LUMINAIRE_NOMINAL_INPUT_POWER; - case 0x009D: - return LUMINAIRE_NOMINAL_MAXIMUM_AC_MAINS_VOLTAGE; - case 0x009E: - return LUMINAIRE_NOMINAL_MINIMUM_AC_MAINS_VOLTAGE; - case 0x009F: - return LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL; - case 0x00A0: - return LUMINAIRE_TIME_OF_MANUFACTURE; - case 0x00A1: - return MAGNETIC_DECLINATION; - case 0x00A2: - return MAGNETIC_FLUX_DENSITY_2D; - case 0x00A3: - return MAGNETIC_FLUX_DENSITY_3D; - case 0x00A4: - return NOMINAL_LIGHT_OUTPUT; - case 0x00A5: - return OVERALL_FAILURE_CONDITION; - case 0x00A6: - return POLLEN_CONCENTRATION; - case 0x00A7: - return PRESENT_INDOOR_RELATIVE_HUMIDITY; - case 0x00A8: - return PRESENT_OUTDOOR_RELATIVE_HUMIDITY; - case 0x00A9: - return PRESSURE; - case 0x00AA: - return RAINFALL; - case 0x00AB: - return RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE; - case 0x00AC: - return RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS; - case 0x00AD: - return REFERENCE_TEMPERATURE; - case 0x00AE: - return TOTAL_DEVICE_STARTS; - case 0x00AF: - return TRUE_WIND_DIRECTION; - case 0x00B0: - return TRUE_WIND_SPEED; - case 0x00B1: - return UV_INDEX; - case 0x00B2: - return WIND_CHILL; - case 0x00B3: - return LIGHT_SOURCE_TYPE; - case 0x00B4: - return LUMINAIRE_IDENTIFICATION_STRING; - case 0x00B5: - return OUTPUT_POWER_LIMITATION; - case 0x00B6: - return THERMAL_DERATING; - case 0x00B7: - return OUTPUT_CURRENT_PERCENT; - default: - return UNKNOWN; + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeviceProperty that = (DeviceProperty) o; + return propertyId == that.propertyId; + } - } + @Override + public int hashCode() { + return Objects.hash(propertyId); + } + + public static DeviceProperty from(final short propertyId) { + return from(SensorFormat.FORMAT_B, propertyId); } public static DeviceProperty from(final SensorFormat sensorFormat, final short propertyId) { - switch (sensorFormat) { - case FORMAT_A: - for (DeviceProperty deviceProperty : values()) { - if ((deviceProperty.propertyId & 0x7FF) == propertyId) { - return deviceProperty; - } - } - case FORMAT_B: - return from(propertyId); - default: - return UNKNOWN; + if (sensorFormat == SensorFormat.FORMAT_B) { + return new DeviceProperty(propertyId); + } else { + return new DeviceProperty((short) (propertyId & 0x7FFF)); } } - /** - * Returns the property name for a given property. - * - * @param deviceProperty Device property - */ public static String getPropertyName(final DeviceProperty deviceProperty) { - switch (deviceProperty) { - case AVERAGE_AMBIENT_TEMPERATURE_IN_A_PERIOD_OF_DAY: - return "Average Ambient Temperature In A Period Of Day"; - case AVERAGE_INPUT_CURRENT: - return "Average Input Current"; - case AVERAGE_INPUT_VOLTAGE: - return "Average Input Voltage"; - case AVERAGE_OUTPUT_CURRENT: - return "Average Output Current"; - case AVERAGE_OUTPUT_VOLTAGE: - return "Average Output Voltage"; - case CENTER_BEAM_INTENSITY_AT_FULL_POWER: - return "Center Beam Intensity At Full Power"; - case CHROMATICITY_TOLERANCE: - return "Chromaticity Tolerance"; - case COLOR_RENDERING_INDEX_R9: - return "Color Rendering Index R9"; - case COLOR_RENDERING_INDEX_RA: - return "Color Rendering Index Ra"; - case DEVICE_APPEARANCE: - return "Device Appearance"; - case DEVICE_COUNTRY_OF_ORIGIN: - return "Device Country Of Origin"; - case DEVICE_DATE_OF_MANUFACTURE: - return "Device Date Of Manufacture"; - case DEVICE_ENERGY_USE_SINCE_TURN_ON: - return "Device Energy Use Since Turn On"; - case DEVICE_FIRMWARE_REVISION: - return "Device Firmware Revision"; - case DEVICE_GLOBAL_TRADE_ITEM_NUMBER: - return "Device Global Trade Item Number"; - case DEVICE_HARDWARE_REVISION: - return "Device Hardware Revision"; - case DEVICE_MANUFACTURER_NAME: - return "Device Manufacturer Name"; - case DEVICE_MODEL_NUMBER: - return "Device Model Number"; - case DEVICE_OPERATING_TEMPERATURE_RANGE_SPECIFICATION: - return "Device Operating Temperature Range Specification"; - case DEVICE_OPERATING_TEMPERATURE_STATISTICAL_VALUES: - return "Device Operating Temperature Statistical Values"; - case DEVICE_OVER_TEMPERATURE_EVENT_STATISTICS: - return "Device Over Temperature Event Statistics"; - case DEVICE_POWER_RANGE_SPECIFICATION: - return "Device Power Range Specification"; - case DEVICE_RUN_TIME_SINCE_TURN_ON: - return "Device Runtime Since Turn On"; - case DEVICE_RUNTIME_WARRANTY: - return "Device Runtime Warranty"; - case DEVICE_SERIAL_NUMBER: - return "Device Serial Number"; - case DEVICE_SOFTWARE_REVISION: - return "Device Software Revision"; - case DEVICE_UNDER_TEMPERATURE_EVENT_STATISTICS: - return "Device Under Temperature Event Statistics"; - case INDOOR_AMBIENT_TEMPERATURE_STATISTICAL_VALUES: - return "Indoor Ambient Temperature Statistical Values"; - case INITIAL_CIE1931_CHROMATICITY_COORDINATES: - return "Initial CIE 1931 Chromaticity Coordinates"; - case INITIAL_CORRELATED_COLOR_TEMPERATURE: - return "Initial Correlated Color Temperature"; - case INITIAL_LUMINOUS_FLUX: - return "Initial Luminous Flux"; - case INITIAL_PLANCKIAN_DISTANCE: - return "Initial Planckian Distance"; - case INPUT_CURRENT_RANGE_SPECIFICATION: - return "Input Current Range Specification"; - case INPUT_CURRENT_STATISTICS: - return "Input Current Statistics"; - case INPUT_OVER_CURRENT_EVENT_STATISTICS: - return "Input Over Current Event Statistics"; - case INPUT_OVER_RIPPLE_VOLTAGE_EVENT_STATISTICS: - return "Input Over Ripple Voltage Event Statistics"; - case INPUT_OVER_VOLTAGE_EVENT_STATISTICS: - return "Input Over Voltage Event Statistics"; - case INPUT_UNDERCURRENT_EVENT_STATISTICS: - return "Input Under Current Event Statistics"; - case INPUT_UNDER_VOLTAGE_EVENT_STATISTICS: - return "Input Under Voltage Event Statistics"; - case INPUT_VOLTAGE_RANGE_SPECIFICATION: - return "Input Voltage Range Specification"; - case INPUT_VOLTAGE_RIPPLE_SPECIFICATION: - return "Input Voltage Ripple Specification"; - case INPUT_VOLTAGE_STATISTICS: - return "Input Voltage Statistics"; - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON: - return "Light Control Ambient LuxLevel On"; - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG: - return "Light Control Ambient LuxLevel Prolong"; - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY: - return "Light Control Ambient LuxLevel Standby"; - case LIGHT_CONTROL_LIGHTNESS_ON: - return "Light Control Lightness On"; - case LIGHT_CONTROL_LIGHTNESS_PROLONG: - return "Light Control Lightness Prolong"; - case LIGHT_CONTROL_LIGHTNESS_STANDBY: - return "Light Control Lightness Standby"; - case LIGHT_CONTROL_REGULATOR_ACCURACY: - return "Light Control Regulator Accuracy"; - case LIGHT_CONTROL_REGULATOR_KID: - return "Light Control Regulator Kid"; - case LIGHT_CONTROL_REGULATOR_KIU: - return "Light Control Regulator Kiu"; - case LIGHT_CONTROL_REGULATOR_KPD: - return "Light Control Regulator Kpd"; - case LIGHT_CONTROL_REGULATOR_KPU: - return "Light Control Regulator Kpu"; - case LIGHT_CONTROL_TIME_FADE: - return "Light Control Time Fade"; - case LIGHT_CONTROL_TIME_FADE_ON: - return "Light Control Time Fade On"; - case LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO: - return "Light Control Time Fade Standby Auto"; - case LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL: - return "Light Control Time Fade Standby Manual"; - case LIGHT_CONTROL_TIME_OCCUPANCY_DELAY: - return "Light Control Time Occupancy Delay"; - case LIGHT_CONTROL_TIME_PROLONG: - return "Light Control Time Prolong"; - case LIGHT_CONTROL_TIME_RUN_ON: - return "Light Control Time Run On"; - case LUMEN_MAINTENANCE_FACTOR: - return "Lumen Maintenance Factor"; - case LUMINOUS_EFFICACY: - return "Luminous Efficacy"; - case LUMINOUS_ENERGY_SINCE_TURN_ON: - return "Luminous Energy Since Turn On"; - case LUMINOUS_EXPOSURE: - return "Luminous Exposure"; - case LUMINOUS_FLUX_RANGE: - return "Luminous Flux Range"; - case MOTION_SENSED: - return "Motion Sensed"; - case MOTION_THRESHOLD: - return "Motion Threshold"; - case OPEN_CIRCUIT_EVENT_STATISTICS: - return "Open Circuit Event Statistics"; - case OUTDOOR_STATISTICAL_VALUES: - return "Outdoor Statistical Values"; - case OUTPUT_CURRENT_RANGE: - return "Output Current Range"; - case OUTPUT_CURRENT_STATISTICS: - return "Output Current Statistics"; - case OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION: - return "Output Ripple Voltage Specification"; - case OUTPUT_VOLTAGE_RANGE: - return "Output Voltage Range"; - case OUTPUT_VOLTAGE_STATISTICS: - return "Output Voltage Statistics"; - case OVER_OUTPUT_RIPPLE_VOLTAGE_EVENT_STATISTICS: - return "Over Output Ripple Voltage Event Statistics"; - case PEOPLE_COUNT: - return "People Count"; - case PRESENCE_DETECTED: - return "Presence Detected"; - case PRESENT_AMBIENT_LIGHT_LEVEL: - return "Present Ambient Light Level"; - case PRESENT_AMBIENT_TEMPERATURE: - return "Present Ambient Temperature"; - case PRESENT_CIE1931_CHROMATICITY_COORDINATES: - return "Present CIE 1931 Chromaticity Coordinates"; - case PRESENT_CORRELATED_COLOR_TEMPERATURE: - return "Present Correlated Color Temperature"; - case PRESENT_DEVICE_INPUT_POWER: - return "Present Device Input Power"; - case PRESENT_DEVICE_OPERATING_EFFICIENCY: - return "Present Device Operating Efficiency"; - case PRESENT_DEVICE_OPERATING_TEMPERATURE: - return "Present Device Operating Temperature"; - case PRESENT_ILLUMINANCE: - return "Present Illuminance"; - case PRESENT_INDOOR_AMBIENT_TEMPERATURE: - return "Present Indoor Ambient Temperature"; - case PRESENT_INPUT_CURRENT: - return "Present Input Current"; - case PRESENT_INPUT_RIPPLE_VOLTAGE: - return "Present Input Ripple Voltage"; - case PRESENT_INPUT_VOLTAGE: - return "Present Input Voltage"; - case PRESENT_LUMINOUS_FLUX: - return "Present Luminous Flux"; - case PRESENT_OUTDOOR_AMBIENT_TEMPERATURE: - return "Present Outdoor Ambient Temperature"; - case PRESENT_OUTPUT_CURRENT: - return "Present Output Current"; - case PRESENT_OUTPUT_VOLTAGE: - return "Present Output Voltage"; - case PRESENT_PLANCKIAN_DISTANCE: - return "Present Planckian Distance"; - case PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE: - return "Present Relative Output Ripple Voltage"; - case RELATIVE_DEVICE_ENERGY_USE_IN_A_PERIOD_OF_DAY: - return "Relative Device Energy Use In A Period Of Day"; - case RELATIVE_DEVICE_RUNTIME_IN_A_GENERIC_LEVEL_RANGE: - return "Relative Device Runtime In A Generic Level Range"; - case RELATIVE_EXPOSURE_TIME_IN_AN_ILLUMINANCE_RANGE: - return "Relative Exposure Time In An Illuminance Range"; - case RELATIVE_RUNTIME_IN_A_CORRELATED_COLOR_TEMPERATURE_RANGE: - return "Relative Runtime In A Correlated Color Temperature Range"; - case RELATIVE_RUNTIME_IN_A_DEVICE_OPERATING_TEMPERATURE_RANGE: - return "Relative Runtime In A Device Operating Temperature Range"; - case RELATIVE_RUNTIME_IN_AN_INPUT_CURRENT_RANGE: - return "Relative Runtime In An Input Current Range"; - case RELATIVE_RUNTIME_IN_AN_INPUT_VOLTAGE_RANGE: - return "Relative Runtime In An Input Voltage Range"; - case SHORT_CIRCUIT_EVENT_STATISTICS: - return "Short Circuit Event Statistics"; - case TIME_SINCE_MOTION_SENSED: - return "Time Since Motion Sensed"; - case TIME_SINCE_PRESENCE_DETECTED: - return "Time Since Presence Detected"; - case TOTAL_DEVICE_ENERGY_USE: - return "Total Device Energy Use"; - case TOTAL_DEVICE_OFF_ON_CYCLES: - return "Total Device Off On Cycles"; - case TOTAL_DEVICE_POWER_ON_CYCLES: - return "Total Device Power On Cycles"; - case TOTAL_DEVICE_POWER_ON_TIME: - return "Total Device Power On Time"; - case TOTAL_DEVICE_RUNTIME: - return "Total Device Runtime"; - case TOTAL_LIGHT_EXPOSURE_TIME: - return "Total Light Exposure Time"; - case TOTAL_LUMINOUS_ENERGY: - return "Total Luminous Energy"; - case DESIRED_AMBIENT_TEMPERATURE: - return "Desired Ambient Temperature"; - case PRECISE_TOTAL_DEVICE_ENERGY_USE: - return "Precise Total Device Energy Use"; - case POWER_FACTOR: - return "Power Factor"; - case SENSOR_GAIN: - return "Sensor Gain"; - case PRECISE_PRESENT_AMBIENT_TEMPERATURE: - return "Precise Present Ambient Temperature"; - case PRESENT_AMBIENT_RELATIVE_HUMIDITY: - return "Present Ambient Relative Humidity"; - case PRESENT_AMBIENT_CARBONDIOXIDE_CONCENTRATION: - return "Present Ambient Carbon Dioxide Concentration"; - case PRESENT_AMBIENT_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION: - return "Present Ambient Volatile Organic Compounds Concentration"; - case PRESENT_AMBIENT_NOISE: - return "Present Ambient Noise"; - case ACTIVE_ENERGY_LOAD_SIDE: - return "Active Energy Loadside"; - case ACTIVE_POWER_LOAD_SIDE: - return "Active Power Loadside"; - case AIR_PRESSURE: - return "Air Pressure"; - case APPARENT_ENERGY: - return "Apparent Energy"; - case APPARENT_POWER: - return "Apparent Power"; - case APPARENT_WIND_DIRECTION: - return "Apparent Wind Direction"; - case APPARENT_WIND_SPEED: - return "Apparent Wind Speed"; - case DEW_POINT: - return "Dew Point"; - case EXTERNAL_SUPPLY_VOLTAGE: - return "External Supply Voltage"; - case EXTERNAL_SUPPLY_VOLTAGE_FREQUENCY: - return "External Supply Voltage Frequency"; - case GUST_FACTOR: - return "Gust Factor"; - case HEAT_INDEX: - return "Heat Index"; - case LIGHT_DISTRIBUTION: - return "Light Distribution"; - case LIGHT_SOURCE_CURRENT: - return "Light Source Current"; - case LIGHT_SOURCE_ON_TIME_NOT_RESETTABLE: - return "Light Source On Time Not Resettable"; - case LIGHT_SOURCE_ON_TIME_RESETTABLE: - return "Light Source On Time Resettable"; - case LIGHT_SOURCE_OPEN_CIRCUIT_STATISTICS: - return "Light Source Open Circuit Statistics"; - case LIGHT_SOURCE_OVERALL_FAILURES_STATISTICS: - return "Light Source Overall Failures Statistics"; - case LIGHT_SOURCE_SHORT_CIRCUIT_STATISTICS: - return "Light Source Short Circuit Statistics"; - case LIGHT_SOURCE_START_COUNTER_RESETTABLE: - return "Light Source Start Counter Resettable"; - case LIGHT_SOURCE_TEMPERATURE: - return "Light Source Temperature"; - case LIGHT_SOURCE_THERMAL_DERATING_STATISTICS: - return "Light Source Thermal Derating Statistics"; - case LIGHT_SOURCE_THERMAL_SHUTDOWN_STATISTICS: - return "Light Source Thermal Shutdown Statistics"; - case LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES: - return "Light Source Total Power On Cycles"; - case LIGHT_SOURCE_VOLTAGE: - return "Light Source Voltage"; - case LUMINAIRE_COLOR: - return "Luminaire Color"; - case LUMINAIRE_IDENTIFICATION_NUMBER: - return "Luminaire Identification Number"; - case LUMINAIRE_MANUFACTURER_GTIN: - return "Luminaire Manufacturer GTIN"; - case LUMINAIRE_NOMINAL_INPUT_POWER: - return "Luminaire Nominal Input Power"; - case LUMINAIRE_NOMINAL_MAXIMUM_AC_MAINS_VOLTAGE: - return "Luminaire Nominal Maximum AC Mains Voltage"; - case LUMINAIRE_NOMINAL_MINIMUM_AC_MAINS_VOLTAGE: - return "Luminaire Nominal Minimum AC Mains Voltage"; - case LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL: - return "Luminaire Power At Minimum Dim Level"; - case LUMINAIRE_TIME_OF_MANUFACTURE: - return "Luminaire Time Of Manufacture"; - case MAGNETIC_DECLINATION: - return "Magnetic Declination"; - case MAGNETIC_FLUX_DENSITY_2D: - return "Magnetic Flux Density - 2D"; - case MAGNETIC_FLUX_DENSITY_3D: - return "Magnetic Flux Density - 3D"; - case NOMINAL_LIGHT_OUTPUT: - return "Nominal Light Output"; - case OVERALL_FAILURE_CONDITION: - return "Overall Failure Condition"; - case POLLEN_CONCENTRATION: - return "Pollen Concentration"; - case PRESENT_INDOOR_RELATIVE_HUMIDITY: - return "Present Indoor Relative Humidity"; - case PRESENT_OUTDOOR_RELATIVE_HUMIDITY: - return "Present Outdoor Relative Humidity"; - case PRESSURE: - return "Pressure"; - case RAINFALL: - return "Rainfall"; - case RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE: - return "Rated Median Useful Life Of Luminaire"; - case RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS: - return "Rated Median Useful Light Source Starts"; - case REFERENCE_TEMPERATURE: - return "Reference Temperature"; - case TOTAL_DEVICE_STARTS: - return "Total Device Starts"; - case TRUE_WIND_DIRECTION: - return "True Wind Direction"; - case TRUE_WIND_SPEED: - return "True Wind Speed"; - case UV_INDEX: - return "UV Index"; - case WIND_CHILL: - return "Wind Chill"; - case LIGHT_SOURCE_TYPE: - return "Light Source Type"; - case LUMINAIRE_IDENTIFICATION_STRING: - return "Luminaire Identification String"; - case OUTPUT_POWER_LIMITATION: - return "Output Power Limitation"; - case THERMAL_DERATING: - return "Thermal Derating"; - case OUTPUT_CURRENT_PERCENT: - return "Output Current Percent"; - case UNKNOWN: - default: - return "Unknown Device Property"; + if (AVERAGE_AMBIENT_TEMPERATURE_IN_A_PERIOD_OF_DAY.equals(deviceProperty)) { + return "Average Ambient Temperature In A Period Of Day"; + } else if (AVERAGE_INPUT_CURRENT.equals(deviceProperty)) { + return "Average Input Current"; + } else if (AVERAGE_INPUT_VOLTAGE.equals(deviceProperty)) { + return "Average Input Voltage"; + } else if (AVERAGE_OUTPUT_CURRENT.equals(deviceProperty)) { + return "Average Output Current"; + } else if (AVERAGE_OUTPUT_VOLTAGE.equals(deviceProperty)) { + return "Average Output Voltage"; + } else if (CENTER_BEAM_INTENSITY_AT_FULL_POWER.equals(deviceProperty)) { + return "Center Beam Intensity At Full Power"; + } else if (CHROMATICITY_TOLERANCE.equals(deviceProperty)) { + return "Chromaticity Tolerance"; + } else if (COLOR_RENDERING_INDEX_R9.equals(deviceProperty)) { + return "Color Rendering Index R9"; + } else if (COLOR_RENDERING_INDEX_RA.equals(deviceProperty)) { + return "Color Rendering Index Ra"; + } else if (DEVICE_APPEARANCE.equals(deviceProperty)) { + return "Device Appearance"; + } else if (DEVICE_COUNTRY_OF_ORIGIN.equals(deviceProperty)) { + return "Device Country Of Origin"; + } else if (DEVICE_DATE_OF_MANUFACTURE.equals(deviceProperty)) { + return "Device Date Of Manufacture"; + } else if (DEVICE_ENERGY_USE_SINCE_TURN_ON.equals(deviceProperty)) { + return "Device Energy Use Since Turn On"; + } else if (DEVICE_FIRMWARE_REVISION.equals(deviceProperty)) { + return "Device Firmware Revision"; + } else if (DEVICE_GLOBAL_TRADE_ITEM_NUMBER.equals(deviceProperty)) { + return "Device Global Trade Item Number"; + } else if (DEVICE_HARDWARE_REVISION.equals(deviceProperty)) { + return "Device Hardware Revision"; + } else if (DEVICE_MANUFACTURER_NAME.equals(deviceProperty)) { + return "Device Manufacturer Name"; + } else if (DEVICE_MODEL_NUMBER.equals(deviceProperty)) { + return "Device Model Number"; + } else if (DEVICE_OPERATING_TEMPERATURE_RANGE_SPECIFICATION.equals(deviceProperty)) { + return "Device Operating Temperature Range Specification"; + } else if (DEVICE_OPERATING_TEMPERATURE_STATISTICAL_VALUES.equals(deviceProperty)) { + return "Device Operating Temperature Statistical Values"; + } else if (DEVICE_OVER_TEMPERATURE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Device Over Temperature Event Statistics"; + } else if (DEVICE_POWER_RANGE_SPECIFICATION.equals(deviceProperty)) { + return "Device Power Range Specification"; + } else if (DEVICE_RUN_TIME_SINCE_TURN_ON.equals(deviceProperty)) { + return "Device Runtime Since Turn On"; + } else if (DEVICE_RUNTIME_WARRANTY.equals(deviceProperty)) { + return "Device Runtime Warranty"; + } else if (DEVICE_SERIAL_NUMBER.equals(deviceProperty)) { + return "Device Serial Number"; + } else if (DEVICE_SOFTWARE_REVISION.equals(deviceProperty)) { + return "Device Software Revision"; + } else if (DEVICE_UNDER_TEMPERATURE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Device Under Temperature Event Statistics"; + } else if (INDOOR_AMBIENT_TEMPERATURE_STATISTICAL_VALUES.equals(deviceProperty)) { + return "Indoor Ambient Temperature Statistical Values"; + } else if (INITIAL_CIE1931_CHROMATICITY_COORDINATES.equals(deviceProperty)) { + return "Initial CIE 1931 Chromaticity Coordinates"; + } else if (INITIAL_CORRELATED_COLOR_TEMPERATURE.equals(deviceProperty)) { + return "Initial Correlated Color Temperature"; + } else if (INITIAL_LUMINOUS_FLUX.equals(deviceProperty)) { + return "Initial Luminous Flux"; + } else if (INITIAL_PLANCKIAN_DISTANCE.equals(deviceProperty)) { + return "Initial Planckian Distance"; + } else if (INPUT_CURRENT_RANGE_SPECIFICATION.equals(deviceProperty)) { + return "Input Current Range Specification"; + } else if (INPUT_CURRENT_STATISTICS.equals(deviceProperty)) { + return "Input Current Statistics"; + } else if (INPUT_OVER_CURRENT_EVENT_STATISTICS.equals(deviceProperty)) { + return "Input Over Current Event Statistics"; + } else if (INPUT_OVER_RIPPLE_VOLTAGE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Input Over Ripple Voltage Event Statistics"; + } else if (INPUT_OVER_VOLTAGE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Input Over Voltage Event Statistics"; + } else if (INPUT_UNDERCURRENT_EVENT_STATISTICS.equals(deviceProperty)) { + return "Input Under Current Event Statistics"; + } else if (INPUT_UNDER_VOLTAGE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Input Under Voltage Event Statistics"; + } else if (INPUT_VOLTAGE_RANGE_SPECIFICATION.equals(deviceProperty)) { + return "Input Voltage Range Specification"; + } else if (INPUT_VOLTAGE_RIPPLE_SPECIFICATION.equals(deviceProperty)) { + return "Input Voltage Ripple Specification"; + } else if (INPUT_VOLTAGE_STATISTICS.equals(deviceProperty)) { + return "Input Voltage Statistics"; + } else if (LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON.equals(deviceProperty)) { + return "Light Control Ambient LuxLevel On"; + } else if (LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG.equals(deviceProperty)) { + return "Light Control Ambient LuxLevel Prolong"; + } else if (LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY.equals(deviceProperty)) { + return "Light Control Ambient LuxLevel Standby"; + } else if (LIGHT_CONTROL_LIGHTNESS_ON.equals(deviceProperty)) { + return "Light Control Lightness On"; + } else if (LIGHT_CONTROL_LIGHTNESS_PROLONG.equals(deviceProperty)) { + return "Light Control Lightness Prolong"; + } else if (LIGHT_CONTROL_LIGHTNESS_STANDBY.equals(deviceProperty)) { + return "Light Control Lightness Standby"; + } else if (LIGHT_CONTROL_REGULATOR_ACCURACY.equals(deviceProperty)) { + return "Light Control Regulator Accuracy"; + } else if (LIGHT_CONTROL_REGULATOR_KID.equals(deviceProperty)) { + return "Light Control Regulator Kid"; + } else if (LIGHT_CONTROL_REGULATOR_KIU.equals(deviceProperty)) { + return "Light Control Regulator Kiu"; + } else if (LIGHT_CONTROL_REGULATOR_KPD.equals(deviceProperty)) { + return "Light Control Regulator Kpd"; + } else if (LIGHT_CONTROL_REGULATOR_KPU.equals(deviceProperty)) { + return "Light Control Regulator Kpu"; + } else if (LIGHT_CONTROL_TIME_FADE.equals(deviceProperty)) { + return "Light Control Time Fade"; + } else if (LIGHT_CONTROL_TIME_FADE_ON.equals(deviceProperty)) { + return "Light Control Time Fade On"; + } else if (LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO.equals(deviceProperty)) { + return "Light Control Time Fade Standby Auto"; + } else if (LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL.equals(deviceProperty)) { + return "Light Control Time Fade Standby Manual"; + } else if (LIGHT_CONTROL_TIME_OCCUPANCY_DELAY.equals(deviceProperty)) { + return "Light Control Time Occupancy Delay"; + } else if (LIGHT_CONTROL_TIME_PROLONG.equals(deviceProperty)) { + return "Light Control Time Prolong"; + } else if (LIGHT_CONTROL_TIME_RUN_ON.equals(deviceProperty)) { + return "Light Control Time Run On"; + } else if (LUMEN_MAINTENANCE_FACTOR.equals(deviceProperty)) { + return "Lumen Maintenance Factor"; + } else if (LUMINOUS_EFFICACY.equals(deviceProperty)) { + return "Luminous Efficacy"; + } else if (LUMINOUS_ENERGY_SINCE_TURN_ON.equals(deviceProperty)) { + return "Luminous Energy Since Turn On"; + } else if (LUMINOUS_EXPOSURE.equals(deviceProperty)) { + return "Luminous Exposure"; + } else if (LUMINOUS_FLUX_RANGE.equals(deviceProperty)) { + return "Luminous Flux Range"; + } else if (MOTION_SENSED.equals(deviceProperty)) { + return "Motion Sensed"; + } else if (MOTION_THRESHOLD.equals(deviceProperty)) { + return "Motion Threshold"; + } else if (OPEN_CIRCUIT_EVENT_STATISTICS.equals(deviceProperty)) { + return "Open Circuit Event Statistics"; + } else if (OUTDOOR_STATISTICAL_VALUES.equals(deviceProperty)) { + return "Outdoor Statistical Values"; + } else if (OUTPUT_CURRENT_RANGE.equals(deviceProperty)) { + return "Output Current Range"; + } else if (OUTPUT_CURRENT_STATISTICS.equals(deviceProperty)) { + return "Output Current Statistics"; + } else if (OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION.equals(deviceProperty)) { + return "Output Ripple Voltage Specification"; + } else if (OUTPUT_VOLTAGE_RANGE.equals(deviceProperty)) { + return "Output Voltage Range"; + } else if (OUTPUT_VOLTAGE_STATISTICS.equals(deviceProperty)) { + return "Output Voltage Statistics"; + } else if (OVER_OUTPUT_RIPPLE_VOLTAGE_EVENT_STATISTICS.equals(deviceProperty)) { + return "Over Output Ripple Voltage Event Statistics"; + } else if (PEOPLE_COUNT.equals(deviceProperty)) { + return "People Count"; + } else if (PRESENCE_DETECTED.equals(deviceProperty)) { + return "Presence Detected"; + } else if (PRESENT_AMBIENT_LIGHT_LEVEL.equals(deviceProperty)) { + return "Present Ambient Light Level"; + } else if (PRESENT_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return "Present Ambient Temperature"; + } else if (PRESENT_CIE1931_CHROMATICITY_COORDINATES.equals(deviceProperty)) { + return "Present CIE 1931 Chromaticity Coordinates"; + } else if (PRESENT_CORRELATED_COLOR_TEMPERATURE.equals(deviceProperty)) { + return "Present Correlated Color Temperature"; + } else if (PRESENT_DEVICE_INPUT_POWER.equals(deviceProperty)) { + return "Present Device Input Power"; + } else if (PRESENT_DEVICE_OPERATING_EFFICIENCY.equals(deviceProperty)) { + return "Present Device Operating Efficiency"; + } else if (PRESENT_DEVICE_OPERATING_TEMPERATURE.equals(deviceProperty)) { + return "Present Device Operating Temperature"; + } else if (PRESENT_ILLUMINANCE.equals(deviceProperty)) { + return "Present Illuminance"; + } else if (PRESENT_INDOOR_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return "Present Indoor Ambient Temperature"; + } else if (PRESENT_INPUT_CURRENT.equals(deviceProperty)) { + return "Present Input Current"; + } else if (PRESENT_INPUT_RIPPLE_VOLTAGE.equals(deviceProperty)) { + return "Present Input Ripple Voltage"; + } else if (PRESENT_INPUT_VOLTAGE.equals(deviceProperty)) { + return "Present Input Voltage"; + } else if (PRESENT_LUMINOUS_FLUX.equals(deviceProperty)) { + return "Present Luminous Flux"; + } else if (PRESENT_OUTDOOR_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return "Present Outdoor Ambient Temperature"; + } else if (PRESENT_OUTPUT_CURRENT.equals(deviceProperty)) { + return "Present Output Current"; + } else if (PRESENT_OUTPUT_VOLTAGE.equals(deviceProperty)) { + return "Present Output Voltage"; + } else if (PRESENT_PLANCKIAN_DISTANCE.equals(deviceProperty)) { + return "Present Planckian Distance"; + } else if (PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE.equals(deviceProperty)) { + return "Present Relative Output Ripple Voltage"; + } else if (RELATIVE_DEVICE_ENERGY_USE_IN_A_PERIOD_OF_DAY.equals(deviceProperty)) { + return "Relative Device Energy Use In A Period Of Day"; + } else if (RELATIVE_DEVICE_RUNTIME_IN_A_GENERIC_LEVEL_RANGE.equals(deviceProperty)) { + return "Relative Device Runtime In A Generic Level Range"; + } else if (RELATIVE_EXPOSURE_TIME_IN_AN_ILLUMINANCE_RANGE.equals(deviceProperty)) { + return "Relative Exposure Time In An Illuminance Range"; + } else if (RELATIVE_RUNTIME_IN_A_CORRELATED_COLOR_TEMPERATURE_RANGE.equals(deviceProperty)) { + return "Relative Runtime In A Correlated Color Temperature Range"; + } else if (RELATIVE_RUNTIME_IN_A_DEVICE_OPERATING_TEMPERATURE_RANGE.equals(deviceProperty)) { + return "Relative Runtime In A Device Operating Temperature Range"; + } else if (RELATIVE_RUNTIME_IN_AN_INPUT_CURRENT_RANGE.equals(deviceProperty)) { + return "Relative Runtime In An Input Current Range"; + } else if (RELATIVE_RUNTIME_IN_AN_INPUT_VOLTAGE_RANGE.equals(deviceProperty)) { + return "Relative Runtime In An Input Voltage Range"; + } else if (SHORT_CIRCUIT_EVENT_STATISTICS.equals(deviceProperty)) { + return "Short Circuit Event Statistics"; + } else if (TIME_SINCE_MOTION_SENSED.equals(deviceProperty)) { + return "Time Since Motion Sensed"; + } else if (TIME_SINCE_PRESENCE_DETECTED.equals(deviceProperty)) { + return "Time Since Presence Detected"; + } else if (TOTAL_DEVICE_ENERGY_USE.equals(deviceProperty)) { + return "Total Device Energy Use"; + } else if (TOTAL_DEVICE_OFF_ON_CYCLES.equals(deviceProperty)) { + return "Total Device Off On Cycles"; + } else if (TOTAL_DEVICE_POWER_ON_CYCLES.equals(deviceProperty)) { + return "Total Device Power On Cycles"; + } else if (TOTAL_DEVICE_POWER_ON_TIME.equals(deviceProperty)) { + return "Total Device Power On Time"; + } else if (TOTAL_DEVICE_RUNTIME.equals(deviceProperty)) { + return "Total Device Runtime"; + } else if (TOTAL_LIGHT_EXPOSURE_TIME.equals(deviceProperty)) { + return "Total Light Exposure Time"; + } else if (TOTAL_LUMINOUS_ENERGY.equals(deviceProperty)) { + return "Total Luminous Energy"; + } else if (DESIRED_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return "Desired Ambient Temperature"; + } else if (PRECISE_TOTAL_DEVICE_ENERGY_USE.equals(deviceProperty)) { + return "Precise Total Device Energy Use"; + } else if (POWER_FACTOR.equals(deviceProperty)) { + return "Power Factor"; + } else if (SENSOR_GAIN.equals(deviceProperty)) { + return "Sensor Gain"; + } else if (PRECISE_PRESENT_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return "Precise Present Ambient Temperature"; + } else if (PRESENT_AMBIENT_RELATIVE_HUMIDITY.equals(deviceProperty)) { + return "Present Ambient Relative Humidity"; + } else if (PRESENT_AMBIENT_CARBONDIOXIDE_CONCENTRATION.equals(deviceProperty)) { + return "Present Ambient Carbon Dioxide Concentration"; + } else if (PRESENT_AMBIENT_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION.equals(deviceProperty)) { + return "Present Ambient Volatile Organic Compounds Concentration"; + } else if (PRESENT_AMBIENT_NOISE.equals(deviceProperty)) { + return "Present Ambient Noise"; + } else if (ACTIVE_ENERGY_LOAD_SIDE.equals(deviceProperty)) { + return "Active Energy Loadside"; + } else if (ACTIVE_POWER_LOAD_SIDE.equals(deviceProperty)) { + return "Active Power Loadside"; + } else if (AIR_PRESSURE.equals(deviceProperty)) { + return "Air Pressure"; + } else if (APPARENT_ENERGY.equals(deviceProperty)) { + return "Apparent Energy"; + } else if (APPARENT_POWER.equals(deviceProperty)) { + return "Apparent Power"; + } else if (APPARENT_WIND_DIRECTION.equals(deviceProperty)) { + return "Apparent Wind Direction"; + } else if (APPARENT_WIND_SPEED.equals(deviceProperty)) { + return "Apparent Wind Speed"; + } else if (DEW_POINT.equals(deviceProperty)) { + return "Dew Point"; + } else if (EXTERNAL_SUPPLY_VOLTAGE.equals(deviceProperty)) { + return "External Supply Voltage"; + } else if (EXTERNAL_SUPPLY_VOLTAGE_FREQUENCY.equals(deviceProperty)) { + return "External Supply Voltage Frequency"; + } else if (GUST_FACTOR.equals(deviceProperty)) { + return "Gust Factor"; + } else if (HEAT_INDEX.equals(deviceProperty)) { + return "Heat Index"; + } else if (LIGHT_DISTRIBUTION.equals(deviceProperty)) { + return "Light Distribution"; + } else if (LIGHT_SOURCE_CURRENT.equals(deviceProperty)) { + return "Light Source Current"; + } else if (LIGHT_SOURCE_ON_TIME_NOT_RESETTABLE.equals(deviceProperty)) { + return "Light Source On Time Not Resettable"; + } else if (LIGHT_SOURCE_ON_TIME_RESETTABLE.equals(deviceProperty)) { + return "Light Source On Time Resettable"; + } else if (LIGHT_SOURCE_OPEN_CIRCUIT_STATISTICS.equals(deviceProperty)) { + return "Light Source Open Circuit Statistics"; + } else if (LIGHT_SOURCE_OVERALL_FAILURES_STATISTICS.equals(deviceProperty)) { + return "Light Source Overall Failures Statistics"; + } else if (LIGHT_SOURCE_SHORT_CIRCUIT_STATISTICS.equals(deviceProperty)) { + return "Light Source Short Circuit Statistics"; + } else if (LIGHT_SOURCE_START_COUNTER_RESETTABLE.equals(deviceProperty)) { + return "Light Source Start Counter Resettable"; + } else if (LIGHT_SOURCE_TEMPERATURE.equals(deviceProperty)) { + return "Light Source Temperature"; + } else if (LIGHT_SOURCE_THERMAL_DERATING_STATISTICS.equals(deviceProperty)) { + return "Light Source Thermal Derating Statistics"; + } else if (LIGHT_SOURCE_THERMAL_SHUTDOWN_STATISTICS.equals(deviceProperty)) { + return "Light Source Thermal Shutdown Statistics"; + } else if (LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES.equals(deviceProperty)) { + return "Light Source Total Power On Cycles"; + } else if (LIGHT_SOURCE_VOLTAGE.equals(deviceProperty)) { + return "Light Source Voltage"; + } else if (LUMINAIRE_COLOR.equals(deviceProperty)) { + return "Luminaire Color"; + } else if (LUMINAIRE_IDENTIFICATION_NUMBER.equals(deviceProperty)) { + return "Luminaire Identification Number"; + } else if (LUMINAIRE_MANUFACTURER_GTIN.equals(deviceProperty)) { + return "Luminaire Manufacturer GTIN"; + } else if (LUMINAIRE_NOMINAL_INPUT_POWER.equals(deviceProperty)) { + return "Luminaire Nominal Input Power"; + } else if (LUMINAIRE_NOMINAL_MAXIMUM_AC_MAINS_VOLTAGE.equals(deviceProperty)) { + return "Luminaire Nominal Maximum AC Mains Voltage"; + } else if (LUMINAIRE_NOMINAL_MINIMUM_AC_MAINS_VOLTAGE.equals(deviceProperty)) { + return "Luminaire Nominal Minimum AC Mains Voltage"; + } else if (LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL.equals(deviceProperty)) { + return "Luminaire Power At Minimum Dim Level"; + } else if (LUMINAIRE_TIME_OF_MANUFACTURE.equals(deviceProperty)) { + return "Luminaire Time Of Manufacture"; + } else if (MAGNETIC_DECLINATION.equals(deviceProperty)) { + return "Magnetic Declination"; + } else if (MAGNETIC_FLUX_DENSITY_2D.equals(deviceProperty)) { + return "Magnetic Flux Density - 2D"; + } else if (MAGNETIC_FLUX_DENSITY_3D.equals(deviceProperty)) { + return "Magnetic Flux Density - 3D"; + } else if (NOMINAL_LIGHT_OUTPUT.equals(deviceProperty)) { + return "Nominal Light Output"; + } else if (OVERALL_FAILURE_CONDITION.equals(deviceProperty)) { + return "Overall Failure Condition"; + } else if (POLLEN_CONCENTRATION.equals(deviceProperty)) { + return "Pollen Concentration"; + } else if (PRESENT_INDOOR_RELATIVE_HUMIDITY.equals(deviceProperty)) { + return "Present Indoor Relative Humidity"; + } else if (PRESENT_OUTDOOR_RELATIVE_HUMIDITY.equals(deviceProperty)) { + return "Present Outdoor Relative Humidity"; + } else if (PRESSURE.equals(deviceProperty)) { + return "Pressure"; + } else if (RAINFALL.equals(deviceProperty)) { + return "Rainfall"; + } else if (RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE.equals(deviceProperty)) { + return "Rated Median Useful Life Of Luminaire"; + } else if (RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS.equals(deviceProperty)) { + return "Rated Median Useful Light Source Starts"; + } else if (REFERENCE_TEMPERATURE.equals(deviceProperty)) { + return "Reference Temperature"; + } else if (TOTAL_DEVICE_STARTS.equals(deviceProperty)) { + return "Total Device Starts"; + } else if (TRUE_WIND_DIRECTION.equals(deviceProperty)) { + return "True Wind Direction"; + } else if (TRUE_WIND_SPEED.equals(deviceProperty)) { + return "True Wind Speed"; + } else if (UV_INDEX.equals(deviceProperty)) { + return "UV Index"; + } else if (WIND_CHILL.equals(deviceProperty)) { + return "Wind Chill"; + } else if (LIGHT_SOURCE_TYPE.equals(deviceProperty)) { + return "Light Source Type"; + } else if (LUMINAIRE_IDENTIFICATION_STRING.equals(deviceProperty)) { + return "Luminaire Identification String"; + } else if (OUTPUT_POWER_LIMITATION.equals(deviceProperty)) { + return "Output Power Limitation"; + } else if (THERMAL_DERATING.equals(deviceProperty)) { + return "Thermal Derating"; + } else if (OUTPUT_CURRENT_PERCENT.equals(deviceProperty)) { + return "Output Current Percent"; + } else { + return "Custom Device Property"; } } @@ -959,108 +595,107 @@ public static DevicePropertyCharacteristic getCharacteristic(@NonNull final D @NonNull final byte[] data, int offset, final int length) { - switch (deviceProperty) { - case PRESENCE_DETECTED: - return data.length == 0 ? new Bool(false) : new Bool(data[offset] == 0x01); - case LIGHT_CONTROL_REGULATOR_ACCURACY: - case OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION: - case INPUT_VOLTAGE_RIPPLE_SPECIFICATION: - case OUTPUT_CURRENT_PERCENT: - case LUMEN_MAINTENANCE_FACTOR: - case MOTION_SENSED: - case MOTION_THRESHOLD: - case PRESENT_DEVICE_OPERATING_EFFICIENCY: - case PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE: - case PRESENT_INPUT_RIPPLE_VOLTAGE: - return new Percentage8(data, offset); - case DESIRED_AMBIENT_TEMPERATURE: - case PRESENT_AMBIENT_TEMPERATURE: - case PRESENT_INDOOR_AMBIENT_TEMPERATURE: - case PRESENT_OUTDOOR_AMBIENT_TEMPERATURE: - return new Temperature(data, offset, 1); - case PRECISE_PRESENT_AMBIENT_TEMPERATURE: - case PRESENT_DEVICE_OPERATING_TEMPERATURE: - return new Temperature(data, offset, 2); - case PEOPLE_COUNT: - return new Count(data, offset, 2); //Count16 - case PRESENT_AMBIENT_RELATIVE_HUMIDITY: - case PRESENT_INDOOR_RELATIVE_HUMIDITY: - case PRESENT_OUTDOOR_RELATIVE_HUMIDITY: - return new Humidity(data, offset); - case LIGHT_CONTROL_LIGHTNESS_ON: - case LIGHT_CONTROL_LIGHTNESS_PROLONG: - case LIGHT_CONTROL_LIGHTNESS_STANDBY: - return new PerceivedLightness(data, offset); - case TIME_SINCE_MOTION_SENSED: - case TIME_SINCE_PRESENCE_DETECTED: - return new TimeSecond(data, offset, 2); - case LIGHT_SOURCE_START_COUNTER_RESETTABLE: - case LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES: - case RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS: - case TOTAL_DEVICE_OFF_ON_CYCLES: - case TOTAL_DEVICE_POWER_ON_CYCLES: - case TOTAL_DEVICE_STARTS: - return new Count(data, offset, 3); - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON: - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG: - case LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY: - case PRESENT_AMBIENT_LIGHT_LEVEL: - case PRESENT_ILLUMINANCE: - return new Illuminance(data, offset); - case DEVICE_RUN_TIME_SINCE_TURN_ON: - case DEVICE_RUNTIME_WARRANTY: - case RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE: - case TOTAL_DEVICE_POWER_ON_TIME: - case TOTAL_DEVICE_RUNTIME: - case TOTAL_LIGHT_EXPOSURE_TIME: - return new TimeHour24(data, offset); - case LIGHT_CONTROL_TIME_FADE: - case LIGHT_CONTROL_TIME_FADE_ON: - case LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO: - case LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL: - case LIGHT_CONTROL_TIME_OCCUPANCY_DELAY: - case LIGHT_CONTROL_TIME_PROLONG: - case LIGHT_CONTROL_TIME_RUN_ON: - return new TimeMillisecond24(data, offset); - case DEVICE_DATE_OF_MANUFACTURE: - case LUMINAIRE_TIME_OF_MANUFACTURE: - return new DateUtc(data, offset); - case PRESSURE: - case AIR_PRESSURE: - return new Pressure(data, offset); - case LIGHT_CONTROL_REGULATOR_KID: - case LIGHT_CONTROL_REGULATOR_KIU: - case LIGHT_CONTROL_REGULATOR_KPD: - case LIGHT_CONTROL_REGULATOR_KPU: - case SENSOR_GAIN: - return new Coefficient(data, offset); - case DEVICE_FIRMWARE_REVISION: - case DEVICE_SOFTWARE_REVISION: - return new FixedString(data, offset, 8); - case DEVICE_HARDWARE_REVISION: - case DEVICE_SERIAL_NUMBER: - return new FixedString(data, offset, 16); - case DEVICE_MODEL_NUMBER: - case LUMINAIRE_COLOR: - case LUMINAIRE_IDENTIFICATION_NUMBER: - return new FixedString(data, offset, 24); - case DEVICE_MANUFACTURER_NAME: - return new FixedString(data, offset, 36); - case LUMINAIRE_IDENTIFICATION_STRING: - return new FixedString(data, offset, 64); - case ACTIVE_ENERGY_LOAD_SIDE: - case PRECISE_TOTAL_DEVICE_ENERGY_USE: - return new Energy32(data, offset); - case ACTIVE_POWER_LOAD_SIDE: - case LUMINAIRE_NOMINAL_INPUT_POWER: - case LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL: - case PRESENT_DEVICE_INPUT_POWER: - return new Power(data, offset); - case PRESENT_INPUT_CURRENT: - case PRESENT_OUTPUT_CURRENT: - return new ElectricCurrent(data, offset); - default: - return new UnknownCharacteristic(data, offset, length); + if (PRESENCE_DETECTED.equals(deviceProperty)) { + return data.length == 0 ? new Bool(false) : new Bool(data[offset] == 0x01); + } else if (LIGHT_CONTROL_REGULATOR_ACCURACY.equals(deviceProperty) || + OUTPUT_RIPPLE_VOLTAGE_SPECIFICATION.equals(deviceProperty) || + INPUT_VOLTAGE_RIPPLE_SPECIFICATION.equals(deviceProperty) || + OUTPUT_CURRENT_PERCENT.equals(deviceProperty) || + LUMEN_MAINTENANCE_FACTOR.equals(deviceProperty) || + MOTION_SENSED.equals(deviceProperty) || + MOTION_THRESHOLD.equals(deviceProperty) || + PRESENT_DEVICE_OPERATING_EFFICIENCY.equals(deviceProperty) || + PRESENT_RELATIVE_OUTPUT_RIPPLE_VOLTAGE.equals(deviceProperty) || + PRESENT_INPUT_RIPPLE_VOLTAGE.equals(deviceProperty)) { + return new Percentage8(data, offset); + } else if (DESIRED_AMBIENT_TEMPERATURE.equals(deviceProperty) || + PRESENT_AMBIENT_TEMPERATURE.equals(deviceProperty) || + PRESENT_INDOOR_AMBIENT_TEMPERATURE.equals(deviceProperty) || + PRESENT_OUTDOOR_AMBIENT_TEMPERATURE.equals(deviceProperty)) { + return new Temperature(data, offset, 1); + } else if (PRECISE_PRESENT_AMBIENT_TEMPERATURE.equals(deviceProperty) || + PRESENT_DEVICE_OPERATING_TEMPERATURE.equals(deviceProperty)) { + return new Temperature(data, offset, 2); + } else if (PEOPLE_COUNT.equals(deviceProperty)) { + return new Count(data, offset, 2); + } else if (PRESENT_AMBIENT_RELATIVE_HUMIDITY.equals(deviceProperty) || + PRESENT_INDOOR_RELATIVE_HUMIDITY.equals(deviceProperty) || + PRESENT_OUTDOOR_RELATIVE_HUMIDITY.equals(deviceProperty)) { + return new Humidity(data, offset); + } else if (LIGHT_CONTROL_LIGHTNESS_ON.equals(deviceProperty) || + LIGHT_CONTROL_LIGHTNESS_PROLONG.equals(deviceProperty) || + LIGHT_CONTROL_LIGHTNESS_STANDBY.equals(deviceProperty)) { + return new PerceivedLightness(data, offset); + } else if (TIME_SINCE_MOTION_SENSED.equals(deviceProperty) || + TIME_SINCE_PRESENCE_DETECTED.equals(deviceProperty)) { + return new TimeSecond(data, offset, 2); + } else if (LIGHT_SOURCE_START_COUNTER_RESETTABLE.equals(deviceProperty) || + LIGHT_SOURCE_TOTAL_POWER_ON_CYCLES.equals(deviceProperty) || + RATED_MEDIAN_USEFUL_LIGHT_SOURCE_STARTS.equals(deviceProperty) || + TOTAL_DEVICE_OFF_ON_CYCLES.equals(deviceProperty) || + TOTAL_DEVICE_POWER_ON_CYCLES.equals(deviceProperty) || + TOTAL_DEVICE_STARTS.equals(deviceProperty)) { + return new Count(data, offset, 3); + } else if (LIGHT_CONTROL_AMBIENT_LUX_LEVEL_ON.equals(deviceProperty) || + LIGHT_CONTROL_AMBIENT_LUX_LEVEL_PROLONG.equals(deviceProperty) || + LIGHT_CONTROL_AMBIENT_LUX_LEVEL_STANDBY.equals(deviceProperty) || + PRESENT_AMBIENT_LIGHT_LEVEL.equals(deviceProperty) || + PRESENT_ILLUMINANCE.equals(deviceProperty)) { + return new Illuminance(data, offset); + } else if (DEVICE_RUN_TIME_SINCE_TURN_ON.equals(deviceProperty) || + DEVICE_RUNTIME_WARRANTY.equals(deviceProperty) || + RATED_MEDIAN_USEFUL_LIFE_OF_LUMINAIRE.equals(deviceProperty) || + TOTAL_DEVICE_POWER_ON_TIME.equals(deviceProperty) || + TOTAL_DEVICE_RUNTIME.equals(deviceProperty) || + TOTAL_LIGHT_EXPOSURE_TIME.equals(deviceProperty)) { + return new TimeHour24(data, offset); + } else if (LIGHT_CONTROL_TIME_FADE.equals(deviceProperty) || + LIGHT_CONTROL_TIME_FADE_ON.equals(deviceProperty) || + LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO.equals(deviceProperty) || + LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL.equals(deviceProperty) || + LIGHT_CONTROL_TIME_OCCUPANCY_DELAY.equals(deviceProperty) || + LIGHT_CONTROL_TIME_PROLONG.equals(deviceProperty) || + LIGHT_CONTROL_TIME_RUN_ON.equals(deviceProperty)) { + return new TimeMillisecond24(data, offset); + } else if (DEVICE_DATE_OF_MANUFACTURE.equals(deviceProperty) || + LUMINAIRE_TIME_OF_MANUFACTURE.equals(deviceProperty)) { + return new DateUtc(data, offset); + } else if (PRESSURE.equals(deviceProperty) || + AIR_PRESSURE.equals(deviceProperty)) { + return new Pressure(data, offset); + } else if (LIGHT_CONTROL_REGULATOR_KID.equals(deviceProperty) || + LIGHT_CONTROL_REGULATOR_KIU.equals(deviceProperty) || + LIGHT_CONTROL_REGULATOR_KPD.equals(deviceProperty) || + LIGHT_CONTROL_REGULATOR_KPU.equals(deviceProperty) || + SENSOR_GAIN.equals(deviceProperty)) { + return new Coefficient(data, offset); + } else if (DEVICE_FIRMWARE_REVISION.equals(deviceProperty) || + DEVICE_SOFTWARE_REVISION.equals(deviceProperty)) { + return new FixedString(data, offset, 8); + } else if (DEVICE_HARDWARE_REVISION.equals(deviceProperty) || + DEVICE_SERIAL_NUMBER.equals(deviceProperty)) { + return new FixedString(data, offset, 16); + } else if (DEVICE_MODEL_NUMBER.equals(deviceProperty) || + LUMINAIRE_COLOR.equals(deviceProperty) || + LUMINAIRE_IDENTIFICATION_NUMBER.equals(deviceProperty)) { + return new FixedString(data, offset, 24); + } else if (DEVICE_MANUFACTURER_NAME.equals(deviceProperty)) { + return new FixedString(data, offset, 36); + } else if (LUMINAIRE_IDENTIFICATION_STRING.equals(deviceProperty)) { + return new FixedString(data, offset, 64); + } else if (ACTIVE_ENERGY_LOAD_SIDE.equals(deviceProperty) || + PRECISE_TOTAL_DEVICE_ENERGY_USE.equals(deviceProperty)) { + return new Energy32(data, offset); + } else if (ACTIVE_POWER_LOAD_SIDE.equals(deviceProperty) || + LUMINAIRE_NOMINAL_INPUT_POWER.equals(deviceProperty) || + LUMINAIRE_POWER_AT_MINIMUM_DIM_LEVEL.equals(deviceProperty) || + PRESENT_DEVICE_INPUT_POWER.equals(deviceProperty)) { + return new Power(data, offset); + } else if (PRESENT_INPUT_CURRENT.equals(deviceProperty) || + PRESENT_OUTPUT_CURRENT.equals(deviceProperty)) { + return new ElectricCurrent(data, offset); + } else { + return new UnknownCharacteristic(data, offset, length); } } -} +} \ No newline at end of file diff --git a/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/MarshalledPropertyId.java b/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/MarshalledPropertyId.java index 81602536..749c91f2 100644 --- a/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/MarshalledPropertyId.java +++ b/mesh/src/main/java/no/nordicsemi/android/mesh/sensorutils/MarshalledPropertyId.java @@ -78,7 +78,7 @@ public int describeContents() { public void writeToParcel(final Parcel dest, final int flags) { dest.writeInt(sensorFormat.ordinal()); dest.writeInt(length); - dest.writeInt(propertyId.ordinal()); + dest.writeInt(propertyId.getPropertyId()); } @Override diff --git a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorDescriptorStatus.java b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorDescriptorStatus.java index ee145272..e8a583bc 100644 --- a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorDescriptorStatus.java +++ b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorDescriptorStatus.java @@ -105,7 +105,7 @@ void parseStatusParameters() { } } - protected DescriptorStatusResult getResult() { + public DescriptorStatusResult getResult() { return result; } diff --git a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSeriesGet.java b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSeriesGet.java index d5fee842..af0137c5 100644 --- a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSeriesGet.java +++ b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSeriesGet.java @@ -33,6 +33,7 @@ public SensorSeriesGet(@NonNull final ApplicationKey appKey, @NonNull final DeviceProperty property) { super(appKey); this.property = property; + assembleMessageParameters(); } /** @@ -62,7 +63,7 @@ public int getOpCode() { @Override void assembleMessageParameters() { mAid = SecureUtils.calculateK4(mAppKey.getKey()); - if (rawValueX1 != null) { + if (rawValueX1 == null) { mParameters = ByteBuffer.allocate(2).order(LITTLE_ENDIAN) .putShort(property.getPropertyId()) .array(); diff --git a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSettingGet.java b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSettingGet.java index a96f3d46..ac106ce4 100644 --- a/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSettingGet.java +++ b/mesh/src/main/java/no/nordicsemi/android/mesh/transport/SensorSettingGet.java @@ -48,7 +48,10 @@ public int getOpCode() { void assembleMessageParameters() { mAid = SecureUtils.calculateK4(mAppKey.getKey()); if (propertyId != null) - mParameters = ByteBuffer.allocate(2).order(LITTLE_ENDIAN).putShort(propertyId.getPropertyId()).array(); + mParameters = ByteBuffer.allocate(4).order(LITTLE_ENDIAN) + .putShort(propertyId.getPropertyId()) + .putShort(sensorSettingPropertyId.getPropertyId()) + .array(); } /**