Coder Social home page Coder Social logo

Comments (7)

marcelveldt avatar marcelveldt commented on August 18, 2024

we should be explicit in assigning the scale (0 for celsius and 1 for fahrenheit)

from certification-backlog.

AlCalzone avatar AlCalzone commented on August 18, 2024

This does not happen if the first received report has an unknown unit:

Image

from certification-backlog.

raman325 avatar raman325 commented on August 18, 2024

so I think the problem is that we generate the scales up front instead of responding to the device. So if there is a value update that changes the scale, we don't evaluate it. I don't understand how a 3 turned to fahrenheit unless we have some code that defaults back to it in some scenarios.

from certification-backlog.

MartinHjelmare avatar MartinHjelmare commented on August 18, 2024

From reading the entity helper code, the logic is like this that I can tell:

The entity is first added to the state machine and an entity registry entry is created for it. The unit that the entity has at that time will be set both in the state machine and in the entity registry. When the entity state is updated and the unit reported by the entity is None, the unit in the entity registry will be preferred. The entity registry entry is not updated unless the user overrides an attribute or if an integration makes an explicit update to the entity registry, eg during a migration, or if the entity is removed and added again. The entity registry is persistent between restarts.

Example 1:

  • entity 1 is added with unit None: -> no unit is shown
  • entity 1 updates unit to C: -> unit C is shown
  • entity 1 updates unit to None: -> no unit is shown

Example 2:

  • entity 2 is added with unit C: -> unit C is shown
  • entity 2 updates unit to None: -> unit C is still shown
  • entity 2 updates unit to F: -> unit F is shown
  • entity 2 updates unit to None: -> unit C is shown again

Moving back to the Z-Wave integration specifics: Scale 2 is not in the temperature scales (0 or 1), of the enum, so the library will raise UnknownValueData and the temperature unit will be reported as None. See the example above what affect that could have on the entity state in different cases.

from certification-backlog.

MartinHjelmare avatar MartinHjelmare commented on August 18, 2024

Closed by mistake.

from certification-backlog.

MartinHjelmare avatar MartinHjelmare commented on August 18, 2024

Thinking about if we should change anything in the integration: Why should we consider an unknown scale to be accurate after we have had a report of a known scale from a device? Are there sensible use cases for this?

from certification-backlog.

AlCalzone avatar AlCalzone commented on August 18, 2024

Passing certification 🤷🏻‍♂️
Other than that I can't think of anything.

from certification-backlog.

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.