Normalize line endings

This commit is contained in:
Andrew Marks 2020-07-22 10:30:57 -04:00
parent fbbbe039db
commit 0cdb851ff2
5 changed files with 271 additions and 254 deletions

10
.gitattributes vendored Normal file
View File

@ -0,0 +1,10 @@
# Generic stuff
* text=auto
# Source files
# ============
*.py text diff=python eol=lf
# Config and data files
*.json text eol=lf
*.yaml text eol=lf

View File

@ -3,7 +3,7 @@
"name": "Shark IQ",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/sharkiq",
"requirements": ["sharkiqpy==0.1.0"],
"requirements": ["sharkiqpy==0.1.1"],
"dependencies": [],
"codeowners": ["@ajmarks"]
}

View File

@ -105,11 +105,7 @@ class SharkVacuumEntity(StateVacuumEntity):
@property
def is_docked(self) -> Optional[bool]:
"""Is vacuum docked"""
docked_status = self.sharkiq.get_property_value(Properties.DOCKED_STATUS)
if docked_status is None:
return None
else:
return docked_status == 1
return self.sharkiq.get_property_value(Properties.DOCKED_STATUS)
@property
def error_code(self) -> Optional[int]:
@ -230,3 +226,14 @@ class SharkVacuumEntity(StateVacuumEntity):
def fan_speed_list(self):
"""Get the list of available fan speed steps of the vacuum cleaner."""
return list(FAN_SPEEDS_MAP.keys())
# Various attributes we want to expose
@property
def recharge_resume(self) -> Optional[bool]:
"""Recharge and resume mode active"""
return self.sharkiq.get_property_value(Properties.RECHARGE_RESUME)
@property
def rssi(self) -> Optional[int]:
"""WiFi RSSI"""
return self.sharkiq.get_property_value(Properties.RSSI)