Skip to content

Commit

Permalink
Add miio.vacuum to maintain backwards compat, add deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Nov 29, 2021
1 parent 36ceb4c commit b7c0f9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions miio/integrations/vacuum/roborock/tests/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,6 @@ def test_mop_mode(self):
def test_deprecated_vacuum(caplog):
with pytest.deprecated_call():
Vacuum("127.1.1.1", "68ffffffffffffffffffffffffffffff")

with pytest.deprecated_call():
from miio.vacuum import ROCKROBO_S6 # noqa: F401
10 changes: 10 additions & 0 deletions miio/vacuum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""This file is just for compat reasons and prints out a deprecated warning when
executed."""
import warnings

from .integrations.vacuum.roborock.vacuum import * # noqa: F403,F401

warnings.warn(
"miio.vacuum module has been renamed to miio.integrations.vacuum.roborock.vacuum",
DeprecationWarning,
)

0 comments on commit b7c0f9d

Please sign in to comment.