Skip to content

Commit 7d74ccd

Browse files
committed
chore: use datetime.timezone.utc in device_registration and remove unused test constants
- Replace datetime.UTC with datetime.timezone.utc in DeviceRegistrationMixin.register_device - Remove unused constants from test_heating_extended.py (_TARGET_TEMP, _MANUAL_MODE, _BOOST_MODE, _BOOST_MINS)
1 parent 6c08bed commit 7d74ccd

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/api/device_registration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ async def process_device_challenge(self, challenge_parameters):
116116
timestamp = re.sub(
117117
r" 0(\d) ",
118118
r" \1 ",
119-
datetime.datetime.now(datetime.UTC).strftime("%a %b %d %H:%M:%S UTC %Y"),
119+
datetime.datetime.now(datetime.timezone.utc).strftime(
120+
"%a %b %d %H:%M:%S UTC %Y"
121+
),
120122
)
121123
hkdf = await self.get_device_authentication_key(
122124
self.device_group_key,

tests/unit/test_heating_extended.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010

1111
_TODAY = str(datetime.date(datetime.now()))
1212
_CURRENT_TEMP = 19.0
13-
_TARGET_TEMP = 21.0
14-
_MANUAL_MODE = "MANUAL"
1513
_SCHEDULE_MODE = "SCHEDULE"
16-
_BOOST_MODE = "BOOST"
1714
_BOOST_MINS = 5
1815
_OFF_MODE = "OFF"
1916

0 commit comments

Comments
 (0)