Skip to content
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

netget/upsrw: display the type (STRING | NUMBER) beside ENUM and RANGE #267

Closed
aquette opened this issue Mar 4, 2016 · 1 comment
Closed
Assignees
Labels
enhancement ready / code review Author (and CI) consider the PR worthy of human rewievers' time
Milestone

Comments

@aquette
Copy link
Member

aquette commented Mar 4, 2016

Quoting @zykh from #265 :
"Looking quickly at netget.c's get_type() (and the same thing applies to upsrw): if a var is an ENUM or RANGE, then the base type (STRING/NUMERIC) is not printed: RANGE implies NUMERIC so we could directly print it if node->range_list exists, while ENUMs should be splitted between STRING and NUMERIC."

From @aquette:
"true for netget / upsrw: the mod is easy for netget, but requires code refactoring for upsrw. I would be in favor of a separate ticket, for 2.7.5, if you don't mind, not to delay much more 2.7.4 Would it be ok for you"

@aquette aquette added this to the 2.7.5 milestone Mar 4, 2016
aquette added a commit that referenced this issue Aug 12, 2016
@aquette aquette self-assigned this Aug 12, 2016
@aquette
Copy link
Member Author

aquette commented Aug 12, 2016

I'm gonna commit the following (note that NUMBER values are also displayed):

before:

[ambient.temperature.low]
Temperature threshold low (degrees C)
Type: NUMBER

[battery.date]
Battery change date
Type: STRING
Maximum length: 128
Value: Not Set

[test.number]
Description unavailable
Type: ENUM
Option: "1" SELECTED
Option: "2"

[ups.start.auto]
UPS starts when mains is (re)applied
Type: ENUM
Option: "yes" SELECTED
Option: "no"

After:

[ambient.temperature.low]
Temperature threshold low (degrees C)
Type: NUMBER
Value: 0

[battery.date]
Battery change date
Type: STRING
Maximum length: 128
Value: Not Set

[test.number]
Description unavailable
Type: ENUM NUMBER
Option: "1" SELECTED
Option: "2"

[ups.start.auto]
UPS starts when mains is (re)applied
Type: ENUM STRING
Maximum length: 128
Option: "yes" SELECTED
Option: "no"

@aquette aquette added the WIP label Aug 16, 2016
aquette added a commit that referenced this issue Aug 16, 2016
Beside from the existing ST_FLAG_STRING, a need has arise to have an explicit
type NUMBER, and thus a flag for this type, can be used generally, and more
specifically with the driver primitive dstate_setflags()

Reference: #267
aquette added a commit that referenced this issue Aug 16, 2016
Allow the drivers to explicitly use ST_FLAG_NUMBER through dstate_setflags()

Reference: #267
aquette added a commit that referenced this issue Aug 16, 2016
Ranges, added through dstate_addrange(), only support numeric ranges. So
automatically add the ST_FLAG_NUMBER flag to range

Reference: #267
aquette added a commit that referenced this issue Aug 16, 2016
ENUM can be either NUMBER or STRING, which was previously not published.

Reference: #267
aquette added a commit that referenced this issue Aug 16, 2016
@aquette aquette added ready / code review Author (and CI) consider the PR worthy of human rewievers' time and removed WIP labels Aug 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready / code review Author (and CI) consider the PR worthy of human rewievers' time
Projects
None yet
Development

No branches or pull requests

1 participant