Bump black from 21.12b0 to 22.1.0 (#169)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
dependabot[bot] 2022-01-31 17:38:57 +01:00 committed by GitHub
parent fea4cb94c9
commit 1eebbfc1e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 20 deletions

View File

@ -102,7 +102,7 @@ class ReconnectLogic(zeroconf.RecordUpdateListener):
# a long time for their device to show up in HA again (this was
# mentioned a lot in early feedback)
tries = min(tries, 10) # prevent OverflowError
wait_time = int(round(min(1.8 ** tries, 60.0)))
wait_time = int(round(min(1.8**tries, 60.0)))
if tries == 1:
_LOGGER.info("Trying to reconnect to %s in the background", self._log_name)
_LOGGER.debug("Retrying %s in %d seconds", self._log_name, wait_time)

View File

@ -1,5 +1,5 @@
pylint==2.12.2
black==21.12b0
black==22.1.0
flake8==4.0.1
isort==5.10.1
mypy==0.931

View File

@ -153,24 +153,18 @@ def test_api_model_base_to_dict():
def test_api_model_base_from_dict():
assert DummyAPIModel.from_dict({}) == DummyAPIModel()
assert (
DummyAPIModel.from_dict(
{
"val1": -1,
"val2": -1,
}
)
== DummyAPIModel(val1=-1, val2=None)
)
assert (
DummyAPIModel.from_dict(
{
"val1": -1,
"unknown": 100,
}
)
== DummyAPIModel(val1=-1)
)
assert DummyAPIModel.from_dict(
{
"val1": -1,
"val2": -1,
}
) == DummyAPIModel(val1=-1, val2=None)
assert DummyAPIModel.from_dict(
{
"val1": -1,
"unknown": 100,
}
) == DummyAPIModel(val1=-1)
assert ListAPIModel.from_dict({}) == ListAPIModel()
assert ListAPIModel.from_dict({"val": []}) == ListAPIModel()