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

Study the possibility to default to type 'STRING' for variables #266

Open
aquette opened this issue Mar 4, 2016 · 3 comments
Open

Study the possibility to default to type 'STRING' for variables #266

aquette opened this issue Mar 4, 2016 · 3 comments
Milestone

Comments

@aquette
Copy link
Member

aquette commented Mar 4, 2016

Quoting @zykh from #265:
"I know that most of our vars are numbers and so it's easier to only edit the type for the few string ones, but maybe it would be better to have 'STRING' as the default type, since a number can always be stored in a string (well.. not always true, but pretend it to be), but not viceversa: if, for some reason, we lie (like me forgetting to set a var as the correct base type STRING/NUMERIC), then if the default type is STRING and the var is not, we're not doing something as bad as if the default type were NUMERIC and the var a string."

From @aquette:
"defaulting to string would be interesting, but would require to define explicitly a ST_FLAG_NUMBER and to apply it everywhere (where there is no ST_FLAG_STRING) to be useful."

@aquette aquette added this to the 2.7.5 milestone Mar 4, 2016
@aquette aquette modified the milestones: 2.7.6, 2.7.5 Aug 16, 2016
@aquette
Copy link
Member Author

aquette commented Aug 16, 2016

Moving this one for 2.7.6, too intrusive to complete #267

@jimklimov jimklimov modified the milestones: 2.8.1, 2.8.2 Jan 6, 2023
@jimklimov jimklimov modified the milestones: 2.8.2, 2.8.3 Apr 4, 2024
@jimklimov
Copy link
Member

On a related note:

LIST VAR eco650
...
VAR eco650 driver.version.usb "libusb-1.0.24 (API: 0x1000108)"
...

GET TYPE eco650 driver.version.usb
TYPE eco650 driver.version.usb NUMBER

@jimklimov
Copy link
Member

While here, the "IMMUTABLE" flag is also an internal detail that can impact remote users (values that can only be set once).

jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
… NUMBER to help catch code that did not set the flags [networkupstools#266]

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
…c__ and not hard-coded strings [networkupstools#266]

This is more streamlined and also fixes some mis-attributed messages (evolution? copy-paste?)

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
…e as float or long int [networkupstools#266]

If we assume a value without flags is by default a NUMBER but is not,
re-default it to STRING. If it is also flagged explicitly as a NUMBER
but is not, yell a warning for upstream to fix the code. Eventually
this should be a reason to report protocol error, but not now.

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
… NUMBER to help catch code that did not set the flags [networkupstools#266]

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 22, 2024
…c__ and not hard-coded strings [networkupstools#266]

This is more streamlined and also fixes some mis-attributed messages (evolution? copy-paste?)

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
…e as float or long int [networkupstools#266]

If we assume a value without flags is by default a NUMBER but is not,
re-default it to STRING. If it is also flagged explicitly as a NUMBER
but is not, yell a warning for upstream to fix the code. Eventually
this should be a reason to report protocol error, but not now.

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
…MMUTABLE flag propagation on socket protocol (and fix float=>double)

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
…e as float or long int [networkupstools#266]

If we assume a value without flags is by default a NUMBER but is not,
re-default it to STRING. If it is also flagged explicitly as a NUMBER
but is not, yell a warning for upstream to fix the code. Eventually
this should be a reason to report protocol error, but not now.

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
…MMUTABLE flag propagation on socket protocol (and fix float=>double)

Signed-off-by: Jim Klimov <[email protected]>
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
jimklimov added a commit to jimklimov/nut that referenced this issue Jul 23, 2024
@jimklimov jimklimov modified the milestones: 2.8.3, 2.8.4 Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants