diff --git a/README.md b/README.md index 6865821..7ff66f1 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,9 @@ Turns on the collar light after dark if the pet is not home. * Enable possibility of if pet not home and not with owner then trigger lost dog mode # Version History +## 0.0.17 +* Enhancement - added the attribute ConnectedTo which will determine if the pet is connected to a person, base, etc. +* Fix - base data was not updating. This issue is resolved. ## 0.0.16 * Enhancement - requested to add the attributes Activity Type, Current Place Name and Current Place Address. ## 0.0.15 diff --git a/custom_components/tryfi/manifest.json b/custom_components/tryfi/manifest.json index 5fd24a7..d487e9d 100644 --- a/custom_components/tryfi/manifest.json +++ b/custom_components/tryfi/manifest.json @@ -1,7 +1,7 @@ { "domain": "tryfi", "name": "TryFi", - "version": "0.0.16", + "version": "0.0.17", "config_flow": true, "documentation": "https://github.com/sbabcock23/hass-tryfi", "issue_tracker": "https://github.com/sbabcock23/hass-tryfi/issues", diff --git a/custom_components/tryfi/sensor.py b/custom_components/tryfi/sensor.py index cee207f..93ad882 100644 --- a/custom_components/tryfi/sensor.py +++ b/custom_components/tryfi/sensor.py @@ -44,6 +44,8 @@ async def async_setup_entry(hass, config_entry, async_add_devices): new_devices.append(PetGenericSensor(hass, pet, coordinator, "Activity Type")) new_devices.append(PetGenericSensor(hass, pet, coordinator, "Current Place Name")) new_devices.append(PetGenericSensor(hass, pet, coordinator, "Current Place Address")) + new_devices.append(PetGenericSensor(hass, pet, coordinator, "Connected To")) + for base in tryfi.bases: LOGGER.debug(f"Adding Base: {base}") @@ -76,9 +78,7 @@ def baseId(self): @property def base(self): - # FIX - need to update interface with getbase class - #return self.coordinator.data.bases[0] - return self._base + return self.coordinator.data.getBase(self.baseId) @property def device_id(self): @@ -167,6 +167,8 @@ def icon(self): return "mdi:earth" elif self.statType == "Current Place Address": return "mdi:map-marker" + elif self.statType == "Connected To": + return "mdi:human-greeting-proximity" @property def state(self): @@ -176,6 +178,8 @@ def state(self): return self.pet.getCurrPlaceName() elif self.statType == "Current Place Address": return self.pet.getCurrPlaceAddress() + elif self.statType == "Connected To": + return self.pet.device.connectionStateType @property def unit_of_measurement(self): return None