Skip to content

Commit 4642628

Browse files
authored
Remove unused imports and an unreachable statement (#103)
- coordinator/data_processor.py: drop unused 'import re'. - api/parsers/nordpool_parser.py: drop unused 'timezone' from the datetime import (the parser only uses the 'timezone' name as a parameter/dict key). - sensor/price.py: remove an unreachable 'return' after a try/except whose both branches already return (audit finding #31). Pure cleanup; clears the two remaining pylint unused-import warnings. Full unit suite (451) passes.
1 parent 2a4966a commit 4642628

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

custom_components/ge_spot/api/parsers/nordpool_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Parser for Nordpool API responses."""
22

33
import logging
4-
from datetime import datetime, timezone
4+
from datetime import datetime
55
from typing import Dict, Any
66

77
from ..base.price_parser import BasePriceParser

custom_components/ge_spot/coordinator/data_processor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44
import math
5-
import re
65
from datetime import datetime, timedelta
76
from typing import Any, Dict, Optional
87

custom_components/ge_spot/sensor/price.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def get_timestamp(data):
136136
return {"timestamp": formatted_time, "value": price_value}
137137
except (ValueError, TypeError):
138138
return {"timestamp": timestamp, "value": price_value}
139-
return {"timestamp": timestamp, "value": price_value}
140139
return {}
141140

142141
# Initialize parent class

0 commit comments

Comments
 (0)