-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[thing] Added default channel types for electrical energy #3079
Conversation
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
public static final ChannelType SYSTEM_ELECTRIC_POTENTIAL = ChannelTypeBuilder | ||
.state(SYSTEM_CHANNEL_TYPE_UID_ELECTRIC_POTENTIAL, "Electric Potential", "Number:ElectricPotential") | ||
.withDescription("Current electric potential").withCategory("Energy") | ||
.withStateDescriptionFragment( | ||
StateDescriptionFragmentBuilder.create().withReadOnly(true).withPattern("%.1f %unit%").build()) | ||
.withTags(List.of("Measurement", "Voltage")).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this is a good naming? Usually it'll probably be a potential difference (aka voltage), not na absolute potential.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I am not. I tried to create a relation to the dimension to be used with the ItemType and a cluster for electrical Channels. In general we can name all of them just Current, Power, Voltage and Energy - without the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO that would be better from the user perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too.
But there is one problem. The channel type power
already is used for turning devices on and off:
Line 70 in 2779c0f
public static final ChannelTypeUID SYSTEM_CHANNEL_TYPE_UID_POWER = new ChannelTypeUID(BINDING_ID, "power"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep the "Electric" prefix then. There will probably be no clash for "voltage" but "current" could also be related to water or gas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Then I will rename just electric potential to electric voltage and keep the rest.
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
* Added default channel types for electrical energy Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de> GitOrigin-RevId: cda7b09
Signed-off-by: Christoph Weitkamp github@christophweitkamp.de