Skip to content

Commit 6769685

Browse files
lightheadedclaude
andcommitted
feat(button): add "Refresh status" button for mowers
Adds a Refresh status button (button.<mower>_refresh_status) for Luba/Yuka mowers, mirroring the existing spino_refresh_status button the Spino pool cleaner already exposes. Pressing it calls coordinator.async_ensure_fresh_state(), which fires a one-shot report snapshot only when the cached device state is older than 2 minutes (a no-op while a BLE report stream is already feeding fresh data). Rationale: the integration is local_push, so a docked/idle mower stops emitting report_data.dev/.work frames and lawn_mower/activity_mode/ charging/progress freeze at the last snapshot while the connect/RSSI heartbeat keeps updating. There is currently no user-facing way to pull a fresh status on demand: homeassistant.update_entity only reads cached push data, and the map/schedule/RTK sync buttons refresh different data. The only existing way to force a dev refresh is to send a motion command (start/dock/pause). This exposes the gentle refresh primitive on its own so users and automations can bring status current without commanding the mower, bringing mowers to parity with the Spino. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e788139 commit 6769685

14 files changed

Lines changed: 44 additions & 0 deletions

File tree

custom_components/mammotion/button.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ def _nudge_available(coordinator: MammotionBaseUpdateCoordinator) -> bool:
105105
press_fn=lambda coordinator: coordinator.async_sync_schedule(),
106106
entity_category=EntityCategory.CONFIG,
107107
),
108+
MammotionButtonSensorEntityDescription(
109+
key="refresh_status",
110+
press_fn=lambda coordinator: coordinator.async_ensure_fresh_state(),
111+
entity_category=EntityCategory.DIAGNOSTIC,
112+
),
108113
MammotionButtonSensorEntityDescription(
109114
key="resync_rtk_dock",
110115
press_fn=lambda coordinator: coordinator.async_rtk_dock_location(),

custom_components/mammotion/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Restart mower"
394394
},
395+
"refresh_status": {
396+
"name": "Refresh status"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Fetch pool map"
397400
},

custom_components/mammotion/translations/cs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Restartovat sekačku"
394394
},
395+
"refresh_status": {
396+
"name": "Obnovit stav"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Načíst mapu bazénu"
397400
},

custom_components/mammotion/translations/da.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Genstart plæneklipperen"
394394
},
395+
"refresh_status": {
396+
"name": "Opdater status"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Hent poolkort"
397400
},

custom_components/mammotion/translations/de.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Mähroboter neustarten"
394394
},
395+
"refresh_status": {
396+
"name": "Status aktualisieren"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Poolkarte abrufen"
397400
},

custom_components/mammotion/translations/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Restart mower"
394394
},
395+
"refresh_status": {
396+
"name": "Refresh status"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Fetch pool map"
397400
},

custom_components/mammotion/translations/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Redémarrer la tondeuse"
394394
},
395+
"refresh_status": {
396+
"name": "Actualiser le statut"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Récupérer la carte de la piscine"
397400
},

custom_components/mammotion/translations/hu.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Fűnyíró újraindítása"
394394
},
395+
"refresh_status": {
396+
"name": "Állapot frissítése"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Medencetérkép lekérése"
397400
},

custom_components/mammotion/translations/it.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Riavvia il tagliaerba"
394394
},
395+
"refresh_status": {
396+
"name": "Aggiorna stato"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Recupera mappa della piscina"
397400
},

custom_components/mammotion/translations/nl.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@
392392
"restart_mower": {
393393
"name": "Maaier herstarten"
394394
},
395+
"refresh_status": {
396+
"name": "Status vernieuwen"
397+
},
395398
"spino_fetch_map": {
396399
"name": "Zwembadkaart ophalen"
397400
},

0 commit comments

Comments
 (0)