Giter VIP home page Giter VIP logo

Comments (3)

dacarson avatar dacarson commented on July 18, 2024

A couple of points here:

  • I haven't tried telling this plugin to use a different unit than metric
  • I do know that HomeKit internally only uses metric values and it leaves it up to the clients to convert to units that are configured via platform settings or app settings.
  • This plugin seems to assume that all values provided by data providers (eg OpenWeatherMap) are metric
  • If the user has configured via this plugin's settings to use different units, then it converts all values to those units just before providing it the Homebridge. Conversion convenience functions are in util/characteristics.js

So, IMO, the above mentioned code is correct.

from homebridge-weather-plus.

dacarson avatar dacarson commented on July 18, 2024

I understand this better now. This is correct behavior. Internally the plugin keeps all values in metric units.
The reason this plugin has a settings parameter for different units is for when compatibility mode, used for Apple's Home app, has been enabled. When that is enabled, Occupancy sensors are used to report all values that Home app doesn't have native support for. As such, the values are not converted by HomeKit to the locale of your device, rather, they are converted to the units set in the settings and added to the sensor label.

from homebridge-weather-plus.

dacarson avatar dacarson commented on July 18, 2024

Closing this as resolved.

from homebridge-weather-plus.

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.