Skip to content

Commit

Permalink
Added initialization flag for floorplans
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Paap committed Dec 6, 2022
1 parent d7211cb commit e80bdf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pyneato/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, session: Session):
self._session = session
self._robots = []
self._floorplans = []
self._floorplans_initialized = False
self._userdata = set()

@property
Expand All @@ -92,7 +93,7 @@ def floorplans(self) -> List[Floorplan]:
"""
Return set of floorplans for logged in account.
"""
if not self._floorplans:
if not self._floorplans and not self._floorplans_initialized:
self.refresh_floorplans()

return self._floorplans
Expand Down Expand Up @@ -158,6 +159,8 @@ def refresh_floorplans(self):
for robot in self.robots:
self.get_floorplan(robot)

self._floorplans_initialized = True

def get_floorplan(self, robot: Robot):
_LOGGER.debug("Getting floorplan for %s", robot.name)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "pyneato"
version = "0.0.6"
version = "0.0.7"
authors = [
{ name="Benjamin Paap", email="[email protected]" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="pyneato",
version="0.0.6",
version="0.0.7",
description="Python package for controlling Neato pyneato Connected vacuum robot",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit e80bdf7

Please sign in to comment.