1
1
"""Mocks for tests."""
2
2
3
+ from datetime import UTC
3
4
from typing import Any
4
5
from unittest .mock import MagicMock
5
6
@@ -28,6 +29,7 @@ class BinarySensorPropertyMock(BinarySensorProperty):
28
29
def __init__ (self , ** kwargs : Any ) -> None : # pylint: disable=super-init-not-called
29
30
"""Initialize the mock."""
30
31
self ._logger = MagicMock ()
32
+ self ._timezone = UTC
31
33
self .element_uid = "Test"
32
34
self .key_count = 1
33
35
self .sensor_type = "door"
@@ -41,6 +43,7 @@ class BinarySwitchPropertyMock(BinarySwitchProperty):
41
43
def __init__ (self , ** kwargs : Any ) -> None : # pylint: disable=super-init-not-called
42
44
"""Initialize the mock."""
43
45
self ._logger = MagicMock ()
46
+ self ._timezone = UTC
44
47
self .element_uid = "Test"
45
48
self .state = False
46
49
@@ -51,6 +54,7 @@ class ConsumptionPropertyMock(ConsumptionProperty):
51
54
def __init__ (self , ** kwargs : Any ) -> None : # pylint: disable=super-init-not-called
52
55
"""Initialize the mock."""
53
56
self ._logger = MagicMock ()
57
+ self ._timezone = UTC
54
58
self .element_uid = "devolo.Meter:Test"
55
59
self .current_unit = "W"
56
60
self .total_unit = "kWh"
@@ -68,6 +72,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=super-init-not-cal
68
72
self ._unit = "°C"
69
73
self ._value = 20
70
74
self ._logger = MagicMock ()
75
+ self ._timezone = UTC
71
76
72
77
73
78
class BrightnessSensorPropertyMock (MultiLevelSensorProperty ):
@@ -80,6 +85,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=super-init-not-cal
80
85
self ._unit = "%"
81
86
self ._value = 20
82
87
self ._logger = MagicMock ()
88
+ self ._timezone = UTC
83
89
84
90
85
91
class MultiLevelSwitchPropertyMock (MultiLevelSwitchProperty ):
@@ -92,6 +98,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=super-init-not-cal
92
98
self .max = 24
93
99
self ._value = 20
94
100
self ._logger = MagicMock ()
101
+ self ._timezone = UTC
95
102
96
103
97
104
class SirenPropertyMock (MultiLevelSwitchProperty ):
@@ -105,6 +112,7 @@ def __init__(self, **kwargs: Any) -> None: # pylint: disable=super-init-not-cal
105
112
self .switch_type = "tone"
106
113
self ._value = 0
107
114
self ._logger = MagicMock ()
115
+ self ._timezone = UTC
108
116
109
117
110
118
class SettingsMock (SettingsProperty ):
@@ -113,6 +121,7 @@ class SettingsMock(SettingsProperty):
113
121
def __init__ (self , ** kwargs : Any ) -> None : # pylint: disable=super-init-not-called
114
122
"""Initialize the mock."""
115
123
self ._logger = MagicMock ()
124
+ self ._timezone = UTC
116
125
self .name = "Test"
117
126
self .zone = "Test"
118
127
self .tone = 1
0 commit comments