Skip to content

Commit c9a1eca

Browse files
committed
chore: replace em-dash with hyphen across text files
1 parent dc9132c commit c9a1eca

8 files changed

Lines changed: 70 additions & 70 deletions

File tree

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A custom integration that finds and deletes **orphan entities** - entities left
3636

3737
## Web Panel
3838

39-
After installation, the **Orphan Cleaner** icon appears in the HA sidebar. All settings are controlled directly from the panel no configuration flow needed after the initial setup.
39+
After installation, the **Orphan Cleaner** icon appears in the HA sidebar. All settings are controlled directly from the panel - no configuration flow needed after the initial setup.
4040

4141
### Controls
4242

@@ -50,7 +50,7 @@ After installation, the **Orphan Cleaner** icon appears in the HA sidebar. All s
5050
| **Dry run** | Simulate deletion without removing anything (see below) |
5151
| **Filter** | Filter visible results by entity_id or platform |
5252
| **Select all / Deselect** | Bulk checkbox controls |
53-
| **Column headers** | Click to sort by Entity ID, Platform, Detection or Age click again to reverse |
53+
| **Column headers** | Click to sort by Entity ID, Platform, Detection or Age - click again to reverse |
5454
| **Platform badge** | Click on any platform badge to instantly select all entities of that platform |
5555
| **Detection filter** | Dropdown to show only dead entry, unavailable, timestamp or heuristic entities |
5656
| **Delete selected** | Delete selected entities with a confirmation dialog |
@@ -64,11 +64,11 @@ Type a platform name or glob pattern in the **Ignore** field in the control bar
6464

6565
A collapsible section below the control bar. Entries here are saved to the integration's config entry options and automatically loaded on every scan and page load. Supports:
6666

67-
- **Platform names** `tuya`, `shelly`, `imou_life`
68-
- **Platform globs** `imou_*`, `tuya_*`
69-
- **Entity ID globs** `sensor.old_*`, `*_deprecated`, `sensor.*_temp`
67+
- **Platform names** - `tuya`, `shelly`, `imou_life`
68+
- **Platform globs** - `imou_*`, `tuya_*`
69+
- **Entity ID globs** - `sensor.old_*`, `*_deprecated`, `sensor.*_temp`
7070

71-
Entries are saved automatically when added or removed no Save button needed. Use the **?** link for a full syntax reference.
71+
Entries are saved automatically when added or removed - no Save button needed. Use the **?** link for a full syntax reference.
7272

7373
### Save & Delete
7474

@@ -81,7 +81,7 @@ Enable the **Dry run** checkbox in the toolbar before deleting. When active:
8181
- An amber warning banner appears to remind you that no changes will be made
8282
- **Delete selected** becomes **Simulate**
8383
- **Save & Delete** is hidden
84-
- Clicking **Simulate** highlights the selected entities with a `would delete` badge for 6 seconds and logs the result nothing is actually removed
84+
- Clicking **Simulate** highlights the selected entities with a `would delete` badge for 6 seconds and logs the result - nothing is actually removed
8585

8686
Dry run is also available as a parameter in the `orphan_cleaner.delete_orphans` service (see Services section).
8787

@@ -117,21 +117,21 @@ Click any platform badge in the results table to instantly select all entities o
117117

118118
## Detection Methods
119119

120-
### Method 1 `orphaned_timestamp` (reliable)
120+
### Method 1 - `orphaned_timestamp` (reliable)
121121

122122
Home Assistant sets this field in the registry when, after a full restart, an entity is not claimed by any integration. This is the official signal and is always active.
123123

124124
**Min age (h)** filters out recently orphaned entities, useful if an integration is temporarily offline. Ages above 24 hours are displayed in days (e.g. `377d`) in the panel table.
125125

126-
### Method 2 Dead config entry
126+
### Method 2 - Dead config entry
127127

128128
If an entity's `config_entry_id` points to a config entry that no longer exists or is in a `FAILED` / `NOT_LOADED` state, the entity is considered an orphan.
129129

130-
### Method 3 Unavailable state
130+
### Method 3 - Unavailable state
131131

132132
Entities in `unavailable` state for longer than **Min age (h)** are flagged. Catches entities that HA marks with the yellow warning "no longer provided by the integration".
133133

134-
### Method 4 Heuristic (optional)
134+
### Method 4 - Heuristic (optional)
135135

136136
Enabled by the **Heuristic** checkbox. Also flags entities with no `config_entry_id` and a platform not in the following exclusion list:
137137

@@ -250,14 +250,14 @@ If you used **Save & Delete**, a backup file was written to `/config/orphan_clea
250250

251251
### What you can do
252252

253-
- **Check if the entity was truly orphaned** look at the `method` and `age_hours` fields. If `age_hours` is low, the integration may have been temporarily offline and the entity could reappear after a restart.
254-
- **Reinstall the integration** if the platform (e.g. `tuya`, `shelly`, `zha`) is still active and the physical device is reachable, removing and re-adding the integration will recreate its entities automatically.
255-
- **Restore custom attributes manually** if the entity reappears, you can reassign its area, icon, and aliases from the HA UI. The backup gives you the original `entity_id` to match it.
256-
- **Clean up the recorder** if the entity had historical data and you want to remove it, use the `recorder.purge_entities` service with the `entity_id` from the backup.
253+
- **Check if the entity was truly orphaned** - look at the `method` and `age_hours` fields. If `age_hours` is low, the integration may have been temporarily offline and the entity could reappear after a restart.
254+
- **Reinstall the integration** - if the platform (e.g. `tuya`, `shelly`, `zha`) is still active and the physical device is reachable, removing and re-adding the integration will recreate its entities automatically.
255+
- **Restore custom attributes manually** - if the entity reappears, you can reassign its area, icon, and aliases from the HA UI. The backup gives you the original `entity_id` to match it.
256+
- **Clean up the recorder** - if the entity had historical data and you want to remove it, use the `recorder.purge_entities` service with the `entity_id` from the backup.
257257

258258
### What cannot be recovered
259259

260-
- The entity registry entry itself HA does not expose an API to re-insert entries manually.
260+
- The entity registry entry itself - HA does not expose an API to re-insert entries manually.
261261
- Historical recorder data is not deleted by this integration, but it will no longer be linked to an active entity.
262262
- If the underlying integration or device no longer exists, the entity cannot be recreated without it.
263263

@@ -274,7 +274,7 @@ All API endpoints require Home Assistant authentication. The panel itself requir
274274
- **Always make a backup** before deleting entities in bulk. Use **Save & Delete** to automatically export a JSON record before each deletion.
275275
- Deleted entities are removed from the **registry**: historical data in the **recorder** remains but is no longer associated with an active entity. To clean the recorder as well, use the `recorder.purge_entities` service.
276276
- An entity with `orphaned_timestamp` may belong to an integration that is temporarily offline. Increase **Min age (h)** if you have unstable integrations.
277-
- Deletion is **irreversible**. Entities cannot be restored from the backup the backup is a reference record only.
277+
- Deletion is **irreversible**. Entities cannot be restored from the backup - the backup is a reference record only.
278278

279279
---
280280

custom_components/orphan_cleaner/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Orphan Entity Cleaner Custom Integration for Home Assistant.
2+
Orphan Entity Cleaner - Custom Integration for Home Assistant.
33
"""
44
from __future__ import annotations
55

@@ -48,7 +48,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
4848
except Exception:
4949
pass
5050

51-
# Use iframe panel pointing directly to panel.html no JS cache issues
51+
# Use iframe panel pointing directly to panel.html - no JS cache issues
5252
frontend.async_register_built_in_panel(
5353
hass,
5454
component_name="iframe",

custom_components/orphan_cleaner/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class OrphanCleanerConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
9-
"""Single-step config flow no parameters needed."""
9+
"""Single-step config flow - no parameters needed."""
1010

1111
VERSION = 1
1212

custom_components/orphan_cleaner/frontend/orphan-cleaner-panel.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Orphan Entity Cleaner Custom Panel per Home Assistant
1+
// Orphan Entity Cleaner - Custom Panel per Home Assistant
22
// Registrato come panel_custom: riceve `hass` con il token già autenticato.
33

44
class OrphanCleanerPanel extends HTMLElement {
@@ -163,9 +163,9 @@ class OrphanCleanerPanel extends HTMLElement {
163163
_updateStats() {
164164
const s = this._state;
165165
const he = s.allOrphans.filter(o => o.method === "heuristic").length;
166-
this._setText("s-total", s.total != null ? s.total : "");
167-
this._setText("s-orphan", s.allOrphans.length || (s.total != null ? "0" : ""));
168-
this._setText("s-heur", s.total != null ? he : "");
166+
this._setText("s-total", s.total != null ? s.total : "-");
167+
this._setText("s-orphan", s.allOrphans.length || (s.total != null ? "0" : "-"));
168+
this._setText("s-heur", s.total != null ? he : "-");
169169
this._setText("s-sel", s.selected.size);
170170
}
171171
_setText(id, val) {
@@ -231,7 +231,7 @@ class OrphanCleanerPanel extends HTMLElement {
231231
? `<span class="badge badge-unavail">unavailable</span>`
232232
: `<span class="badge badge-heuristic">heuristic</span>`;
233233
const dis = e.disabled_by ? `<span class="badge badge-disabled">disabled</span>` : "";
234-
const age = e.age_hours != null ? `${e.age_hours}h` : "";
234+
const age = e.age_hours != null ? `${e.age_hours}h` : "-";
235235
return `<tr>
236236
<td class="td-chk"><input type="checkbox" data-eid="${e.entity_id}" ${chk}></td>
237237
<td><span class="eid">${e.entity_id}</span>${dis}</td>
@@ -417,14 +417,14 @@ class OrphanCleanerPanel extends HTMLElement {
417417
<div class="topbar-title">Orphan Entity Cleaner</div>
418418
</div>
419419
<div class="topbar-spacer"></div>
420-
<div class="cfg-pill" id="cfg-pill"></div>
420+
<div class="cfg-pill" id="cfg-pill">-</div>
421421
</div>
422422
423423
<div class="main">
424424
<div class="stat-row">
425-
<div class="stat"> <div class="s-label">Total entities</div> <div class="s-val" id="s-total"></div></div>
426-
<div class="stat s-danger"> <div class="s-label">Orphans found</div> <div class="s-val" id="s-orphan"></div></div>
427-
<div class="stat s-warn"> <div class="s-label">Heuristic</div><div class="s-val" id="s-heur"></div></div>
425+
<div class="stat"> <div class="s-label">Total entities</div> <div class="s-val" id="s-total">-</div></div>
426+
<div class="stat s-danger"> <div class="s-label">Orphans found</div> <div class="s-val" id="s-orphan">-</div></div>
427+
<div class="stat s-warn"> <div class="s-label">Heuristic</div><div class="s-val" id="s-heur">-</div></div>
428428
<div class="stat s-ok"> <div class="s-label">Selected</div> <div class="s-val" id="s-sel">0</div></div>
429429
</div>
430430
@@ -451,7 +451,7 @@ class OrphanCleanerPanel extends HTMLElement {
451451
<h3>Available services</h3>
452452
<div class="service-row">
453453
<span class="svc-name">orphan_cleaner.scan</span>
454-
<span class="svc-desc">Scans the registry and fires the <code>orphan_cleaner_orphans_found</code> event useful in automations.</span>
454+
<span class="svc-desc">Scans the registry and fires the <code>orphan_cleaner_orphans_found</code> event - useful in automations.</span>
455455
</div>
456456
<div class="service-row">
457457
<span class="svc-name">orphan_cleaner.delete_orphans</span>

0 commit comments

Comments
 (0)