Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7175522f4a | |||
| 3b99c037ae | |||
| 4f8a4304ba | |||
| bcff98b44b |
@@ -1,8 +1,13 @@
|
||||
# CHANGELOG - Whatsapp Bridge Integration
|
||||
|
||||
## Release 0.2.2 - 2026-06-15
|
||||
- **Architecture Change:** Introduced a dedicated "WhatsApp Bridge Hub" device. This central device acts as a single point of reference for global components, preventing UI clutter.
|
||||
- **Fix:** Moved the global live status sensor and the virtual broadcast entity to the new WhatsApp Bridge Hub device. This ensures they remain fully visible and accessible across the Home Assistant UI, automations, and service calls without being duplicated across individual user accounts.
|
||||
- **Improvement:** Maintained isolated, clean individual devices for each configured account profile (*Larissa, Rene, Work*).
|
||||
|
||||
## Release 0.2.1 - 2026-06-15
|
||||
- **Fix:** Resolved device assignment duplication. Instead of a rigid global gateway card duplicating across all account tabs, a distinct and separate Home Assistant device is now generated for each configured account (*Larissa, Rene, Work*).
|
||||
- **Fix:** Globalized the live status sensor and the broadcast entity. They are now instantiated exactly once for the entire integration (rather than incorrectly duplicating per account) and exist as free entities without device assignment to maintain a clean UI layout.
|
||||
- **Fix:** Resolved device assignment duplication where a single global gateway card duplicated across all account tabs.
|
||||
- **Fix:** Globalized the live status sensor and the broadcast entity to instantiate exactly once for the entire integration rather than incorrectly duplicating per account.
|
||||
- **Optimization:** Code refactoring within `sensor.py` to prevent entity duplication when utilizing multiple profiles.
|
||||
|
||||
## Release 0.2.0 - 2026-06-15
|
||||
|
||||
@@ -9,22 +9,34 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
||||
return True
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry):
|
||||
"""Set up entry, create specific contact device and forward to sensor platform."""
|
||||
# Lege die Daten im hass-Objekt ab
|
||||
"""Set up entry, create specific contact device, central hub and forward to platforms."""
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
hass.data[DOMAIN][entry.entry_id] = entry.data
|
||||
|
||||
# 1. Eigenes Gerät SPEZIFISCH für diesen Account/Kontakt anlegen
|
||||
device_registry = dr.async_get(hass)
|
||||
|
||||
# 1. Eigenes Gerät SPEZIFISCH für diesen Account/Kontakt anlegen
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
identifiers={(DOMAIN, entry.entry_id)}, # Einzigartig pro Eintrag
|
||||
name=f"WhatsApp {entry.title}",
|
||||
manufacturer="Bahmcloud",
|
||||
model="Kontakt-Endpunkt",
|
||||
sw_version="0.2.1",
|
||||
sw_version="0.2.2",
|
||||
)
|
||||
|
||||
# 2. Zentralen System-Hub NUR EINMALIG anlegen (wird an den ersten geladenen Account gekoppelt)
|
||||
if not hass.data[DOMAIN].get("hub_device_created"):
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
identifiers={(DOMAIN, "global_bridge_hub")},
|
||||
name="WhatsApp Bridge Hub",
|
||||
manufacturer="Bahmcloud",
|
||||
model="Bridge Server",
|
||||
sw_version="0.2.2",
|
||||
)
|
||||
hass.data[DOMAIN]["hub_device_created"] = True
|
||||
|
||||
# Forward the setup to the sensor platform to create entities
|
||||
await hass.config_entries.async_forward_entry_setups(entry, ["sensor"])
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"documentation": "https://git.bahmcloud.de/bahmcloud/Whatsapp-Bridge-Integration",
|
||||
"dependencies": [],
|
||||
"codeowners": ["@bahmcloud"],
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"iot_class": "local_polling",
|
||||
"config_flow": true
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class WhatsAppAccountEntity(SensorEntity):
|
||||
|
||||
|
||||
class WhatsAppBroadcastEntity(SensorEntity):
|
||||
"""Virtual 'All Accounts' Entity (Global, keinem spezifischen Gerät zugeordnet)."""
|
||||
"""Virtual 'All Accounts' Entity, geordnet unter dem zentralen Hub."""
|
||||
def __init__(self):
|
||||
self._attr_name = "WhatsApp Broadcast (All)"
|
||||
self._attr_unique_id = "whatsapp_bridge_broadcast_all"
|
||||
@@ -91,9 +91,16 @@ class WhatsAppBroadcastEntity(SensorEntity):
|
||||
def state(self):
|
||||
return "Global"
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Ordnet diese Entität dem zentralen Hub-Gerät zu."""
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, "global_bridge_hub")},
|
||||
)
|
||||
|
||||
|
||||
class WhatsAppStatusSensor(SensorEntity):
|
||||
"""Echter Live-Status-Sensor (Global, keinem spezifischen Gerät zugeordnet)."""
|
||||
"""Echter Live-Status-Sensor, geordnet unter dem zentralen Hub."""
|
||||
|
||||
def __init__(self, coordinator):
|
||||
self.coordinator = coordinator
|
||||
@@ -136,6 +143,13 @@ class WhatsAppStatusSensor(SensorEntity):
|
||||
}
|
||||
return {}
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Ordnet diese Entität dem zentralen Hub-Gerät zu."""
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, "global_bridge_hub")},
|
||||
)
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Registrieren beim Live-Coordinator."""
|
||||
self.async_on_remove(
|
||||
|
||||
Reference in New Issue
Block a user