Add battery_level 'VERY_LOW', reduce some log levels, bump version_number

This commit is contained in:
freybene 2024-05-25 08:20:20 +02:00
parent 5ba3e2848d
commit 0f9ae570f6
3 changed files with 6 additions and 5 deletions

View file

@ -3,5 +3,6 @@ CONF_JSESSIONID = "jsessionid"
BATTERY_LEVELS = {
'FULL': 100,
'MEDIUM': 50,
'LOW': 10
'LOW': 15,
'VERY_LOW': 5
}

View file

@ -2,7 +2,7 @@
"domain": "smartthings_find",
"name": "SmartThings Find",
"after_dependencies": ["http"],
"version": "0.0.2",
"version": "0.1.0",
"documentation": "https://github.com/Vedeneb/HA-SmartThings-Find",
"integration_type": "hub",
"dependencies": [],

View file

@ -361,10 +361,10 @@ async def get_device_location(hass: HomeAssistant, session: aiohttp.ClientSessio
elif 'encLocation' in op:
loc = op['encLocation']
if 'encrypted' in loc and loc['encrypted']:
_LOGGER.warn(f"[{dev_name}] Ignoring encrypted location ({op['oprnType']})")
_LOGGER.info(f"[{dev_name}] Ignoring encrypted location ({op['oprnType']})")
continue
elif 'gpsUtcDt' not in loc:
_LOGGER.warn(f"[{dev_name}] Ignoring location with missing date ({op['oprnType']})")
_LOGGER.info(f"[{dev_name}] Ignoring location with missing date ({op['oprnType']})")
continue
else:
utcDate = parse_stf_date(loc['gpsUtcDt'])
@ -396,7 +396,7 @@ async def get_device_location(hass: HomeAssistant, session: aiohttp.ClientSessio
else:
_LOGGER.warn(f"[{dev_name}] No useable location-operation found")
_LOGGER.debug(f" --> {dev_name} used operation:\t{'NONE' if not used_op else used_op['oprnType']}")
_LOGGER.debug(f" --> {dev_name} used operation: {'NONE' if not used_op else used_op['oprnType']}")
else:
_LOGGER.warn(f"[{dev_name}] No operation found in response; marking update failed")