Skip to content

Commit

Permalink
Merge pull request #199 from dckiller51/dependabot/pip/mypy-1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dckiller51 authored Oct 20, 2023
2 parents 8451761 + 4bd457e commit 1f0be1f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
26 changes: 20 additions & 6 deletions custom_components/bodymiscale/metrics/weight.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,28 @@ def get_visceral_fat(
age = metrics[Metric.AGE]

if config[CONF_GENDER] == Gender.MALE:
if (height < weight * 1.6 + 63.0):
vfal = age * 0.15 + ((weight * 305.0) /((height * 0.0826 * height - height * 0.4) + 48.0) - 2.9)
if height < weight * 1.6 + 63.0:
vfal = age * 0.15 + (
(weight * 305.0) / ((height * 0.0826 * height - height * 0.4) + 48.0)
- 2.9
)
else:
vfal = age * 0.15 + (weight * (height * -0.0015 + 0.765) - height * 0.143) - 5.0
vfal = (
age * 0.15
+ (weight * (height * -0.0015 + 0.765) - height * 0.143)
- 5.0
)
else:
if (weight <= height * 0.5 - 13.0):
vfal = age * 0.07 + (weight * (height * -0.0024 + 0.691) - height * 0.027) - 10.5
if weight <= height * 0.5 - 13.0:
vfal = (
age * 0.07
+ (weight * (height * -0.0024 + 0.691) - height * 0.027)
- 10.5
)
else:
vfal = age * 0.07 + ((weight * 500.0) / ((height * 1.45 + height * 0.1158 * height) - 120.0) - 6.0)
vfal = age * 0.07 + (
(weight * 500.0) / ((height * 1.45 + height * 0.1158 * height) - 120.0)
- 6.0
)

return check_value_constraints(vfal, 1, 50)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cachetools==5.3.1
homeassistant>=2023.7.0.b0
mypy==1.6.0
mypy==1.6.1
pre-commit==3.5.0
pylint==3.0.1
types-cachetools
Expand Down

0 comments on commit 1f0be1f

Please sign in to comment.