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

Is UnitPrefix implemented in the best way? #33

Open
flatsiedatsie opened this issue Nov 29, 2018 · 2 comments
Open

Is UnitPrefix implemented in the best way? #33

flatsiedatsie opened this issue Nov 29, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@flatsiedatsie
Copy link
Contributor

I don't know what I'm talking about, but currently the "UnitPrefix" data type seems a bit strange. Right now it can be a property of a thing. This results in something like "pressure" being displayed as a separate string in the interface (in the cases that a MySensors device actually sends a prefix along)

When I looked at set.rs I noticed that there actually is a way to set the pre/postfix of a device.

    pub fn unit(&self) -> &'static str {
        match *self {
            SetReqType::Temp => "celsius",
            SetReqType::Percentage => "%",
            _ => "",
        }
    }

Shouldn't the UnitPrefix data (if MySensors sends it at all) end up in that list?

From my limited understanding, for a device that measures barometric pressure it should send the string "mBar" as the V_UNIT_PREFIX.

V_UNIT_PREFIX is only sent once I think, when the device starts. It has the same child ID as the actual sensor data that will be coming in after it.

@flatsiedatsie
Copy link
Contributor Author

(totally not a priority I would say, things will work just fine if this whole V_UNIT_PREFIX thing is not implemented at all.)

@tsathishkumar
Copy link
Owner

This is interesting idea. For this the controller needs to store the unit prefix of sensor while it is presented and that has to be exposed in WoT api. I'll think about how to handle it better.

@tsathishkumar tsathishkumar added the enhancement New feature or request label Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants