Comments (3)
bodymiscale/custom_components/bodymiscale/__init__.py
Lines 159 to 163 in 676acf2
This is not correct as it ignores leap years.
Try this
https://stackoverflow.com/questions/2217488/age-from-birthdate-in-python
def calculate_age(born):
today = date.today()
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
from bodymiscale.
hello, you are right your solution is good. Thank you for your contribution. I'll be releasing the update this weekend.
from bodymiscale.
update available v1.1.4
from bodymiscale.
Related Issues (20)
- New Error HOT 4
- Amazfit Body Scale HOT 1
- Error after Core version 2023.7.0 installed HOT 12
- Is visceral_fat correct? HOT 5
- Domain changed to number in HA HOT 4
- Unable to config through UI HOT 3
- Home Assistant device name problem HOT 4
- Can't config bodymiscale HOT 17
- Partial deletion problem
- Issue with multiple Services HOT 4
- Integration is crashing after update to 3.1.2 HOT 2
- I made a Traditional Chinese Translation zh-Hant.json to the folder but not work? HOT 8
- Not working in 2024.1 beta HOT 4
- Incorrect womens calculations HOT 4
- Translate HOT 1
- Metrics interpretation HOT 2
- Historical values HOT 1
- Integration is not showing all atrributes
- A bug since version 2024.6.0 HOT 1
- 2 User - User Entities have data but bodymiscale entitiy not HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bodymiscale.