Giter VIP home page Giter VIP logo

Comments (4)

lolodomo avatar lolodomo commented on September 25, 2024

First you have to understand in which cases this default pattern will be used, there are only two cases:

  1. you have an item that is not linked to any channel and of course without any pattern defined on the item itself
  2. you have an item linked to a channel but the binding developer made a bad decision and did not define a default pattern for this channel, and of course without any pattern defined on the item itself

Additionally, for the second case (no pattern defined by the channel), I can also tell you that the default %.0f was there since many many years.

So yes, if you link one item to a channel, the channel provider should provide a proper default pattern and this default would be for example "%.1f %unit%" for a temperature. In case the channel does not provide a default pattern, you can of course define one on your item if the default does not match your need.

In practice, this default pattern is mainly for items that the user do not link to any channel.

from openhab-core.

lolodomo avatar lolodomo commented on September 25, 2024

And to answer to your question, the %.0f was chosen for two reasons:

  1. It was the value requested in the feature request
  2. It made sense to maintain a backward compatibility due to previous default pattern set on channel level.

from openhab-core.

dilyanpalauzov avatar dilyanpalauzov commented on September 25, 2024

It was the value requested in the feature request

I have not thought on the number of digits, but have seen this is default value somewhere. The rationale is that some value has to be selected as default.

from openhab-core.

jimtng avatar jimtng commented on September 25, 2024

Thanks for the explanation.

from openhab-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.