From f63a96d9be55c00fbf25fd8c83655c856818937f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:10:11 +0000 Subject: [PATCH 1/2] Bump mypy from 1.6.0 to 1.6.1 Bumps [mypy](https://github.com/python/mypy) from 1.6.0 to 1.6.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8f85f53..102d05e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 From 4bd457e690e737cd980d96cda72478c8ad29a953 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:10:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../bodymiscale/metrics/weight.py | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/custom_components/bodymiscale/metrics/weight.py b/custom_components/bodymiscale/metrics/weight.py index 7b75ed5..089f4ae 100644 --- a/custom_components/bodymiscale/metrics/weight.py +++ b/custom_components/bodymiscale/metrics/weight.py @@ -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)