add energy meter device type and related units
This commit is contained in:
parent
c02dc3e261
commit
45315d0460
|
@ -217,6 +217,9 @@ enum {
|
|||
*/
|
||||
SR_UNIT_CONCENTRATION,
|
||||
SR_UNIT_REVOLUTIONS_PER_MINUTE,
|
||||
SR_UNIT_VOLT_AMPERE,
|
||||
SR_UNIT_WATT,
|
||||
SR_UNIT_WATT_HOUR,
|
||||
};
|
||||
|
||||
/** Values for sr_datafeed_analog.flags. */
|
||||
|
@ -583,6 +586,9 @@ enum {
|
|||
/** The device can measure humidity. */
|
||||
SR_CONF_HYGROMETER,
|
||||
|
||||
/** The device can measure energy consumption. */
|
||||
SR_CONF_ENERGYMETER,
|
||||
|
||||
/*--- Driver scan options -------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -175,6 +175,14 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
|
|||
break;
|
||||
case SR_UNIT_REVOLUTIONS_PER_MINUTE:
|
||||
si_printf(value, out, "RPM");
|
||||
case SR_UNIT_VOLT_AMPERE:
|
||||
si_printf(value, out, "VA");
|
||||
break;
|
||||
case SR_UNIT_WATT:
|
||||
si_printf(value, out, "W");
|
||||
break;
|
||||
case SR_UNIT_WATT_HOUR:
|
||||
si_printf(value, out, "Wh");
|
||||
break;
|
||||
default:
|
||||
si_printf(value, out, "");
|
||||
|
|
Loading…
Reference in New Issue