Skip to content

Commit 5dc6ed5

Browse files
authored
Merge pull request #6 from benjamin-dcs/sensor-entity_id-changes
entity_id with filename
2 parents 9215889 + 45ef1b7 commit 5dc6ed5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/file_plusplus/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
CONF_TIMESTAMP = "timestamp"
66

7-
DEFAULT_NAME = "File++"
7+
DEFAULT_NAME = "file_plusplus"
88
FILE_ICON = "mdi:file"

custom_components/file_plusplus/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def async_setup_entry(
6262
options = dict(entry.options)
6363
file_path: str = config[CONF_FILE_PATH]
6464
unique_id: str = entry.entry_id
65-
name: str = config.get(CONF_NAME, DEFAULT_NAME)
65+
name: str = config.get(CONF_NAME, DEFAULT_NAME) + "_" + file_path.split("/")[-1].replace(".", "_")
6666
unit: str | None = options.get(CONF_UNIT_OF_MEASUREMENT)
6767
value_template: Template | None = None
6868

0 commit comments

Comments
 (0)