Skip to content

Commit 068880f

Browse files
Fix const file io (#4445)
1 parent 09b4573 commit 068880f

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

custom_components/battery_notes/const.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Constants for battery_notes."""
22

3-
import json
43
from logging import Logger, getLogger
5-
from pathlib import Path
64
from typing import Final
75

86
import voluptuous as vol
@@ -14,14 +12,8 @@
1412

1513
MIN_HA_VERSION = "2025.9.0"
1614

17-
manifestfile = Path(__file__).parent / "manifest.json"
18-
with open(file=manifestfile, encoding="UTF-8") as json_file:
19-
manifest_data = json.load(json_file)
20-
21-
DOMAIN = manifest_data.get("domain")
22-
NAME = manifest_data.get("name")
23-
VERSION = manifest_data.get("version")
24-
ISSUEURL = manifest_data.get("issue_tracker")
15+
DOMAIN = "battery_notes"
16+
NAME = "Battery Notes"
2517
MANUFACTURER = "@Andrew-CodeChimp"
2618
LAST_REPLACED = "battery_last_replaced"
2719
LAST_REPORTED = "battery_last_reported"

custom_components/battery_notes/library_updater.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from .const import (
2626
DEFAULT_LIBRARY_URL,
2727
FALLBACK_LIBRARY_URL,
28-
VERSION,
2928
)
3029
from .coordinator import MY_KEY, BatteryNotesDomainConfig
3130
from .discovery import DiscoveryManager
@@ -34,7 +33,7 @@
3433
_LOGGER = logging.getLogger(__name__)
3534

3635
HEADERS = {
37-
"User-Agent": f"BatteryNotes/{VERSION}",
36+
"User-Agent": f"BatteryNotes",
3837
"Content-Type": CONTENT_TYPE_JSON,
3938
"Accept-Encoding": "gzip",
4039
}

0 commit comments

Comments
 (0)