Skip to content

Commit 2e5da27

Browse files
committed
Add tests
1 parent 7085014 commit 2e5da27

File tree

3 files changed

+523
-0
lines changed

3 files changed

+523
-0
lines changed

tests/components/iron_os/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ def mock_pynecil() -> Generator[AsyncMock]:
183183
desc_scroll_speed=ScrollSpeed.FAST,
184184
logo_duration=LogoDuration.LOOP,
185185
locking_mode=LockingMode.FULL_LOCKING,
186+
animation_loop=True,
187+
cooling_temp_blink=True,
188+
idle_screen_details=True,
189+
solder_screen_details=True,
190+
invert_buttons=True,
191+
display_invert=True,
192+
calibrate_cjc=True,
193+
usb_pd_mode=True,
186194
)
187195
client.get_live_data.return_value = LiveDataResponse(
188196
live_temp=298,
Lines changed: 369 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,369 @@
1+
# serializer version: 1
2+
# name: test_switch_platform[switch.pinecil_animation_loop-entry]
3+
EntityRegistryEntrySnapshot({
4+
'aliases': set({
5+
}),
6+
'area_id': None,
7+
'capabilities': None,
8+
'config_entry_id': <ANY>,
9+
'device_class': None,
10+
'device_id': <ANY>,
11+
'disabled_by': None,
12+
'domain': 'switch',
13+
'entity_category': <EntityCategory.CONFIG: 'config'>,
14+
'entity_id': 'switch.pinecil_animation_loop',
15+
'has_entity_name': True,
16+
'hidden_by': None,
17+
'icon': None,
18+
'id': <ANY>,
19+
'labels': set({
20+
}),
21+
'name': None,
22+
'options': dict({
23+
}),
24+
'original_device_class': None,
25+
'original_icon': None,
26+
'original_name': 'Animation loop',
27+
'platform': 'iron_os',
28+
'previous_unique_id': None,
29+
'supported_features': 0,
30+
'translation_key': <IronOSSwitch.ANIMATION_LOOP: 'animation_loop'>,
31+
'unique_id': 'c0:ff:ee:c0:ff:ee_animation_loop',
32+
'unit_of_measurement': None,
33+
})
34+
# ---
35+
# name: test_switch_platform[switch.pinecil_animation_loop-state]
36+
StateSnapshot({
37+
'attributes': ReadOnlyDict({
38+
'friendly_name': 'Pinecil Animation loop',
39+
}),
40+
'context': <ANY>,
41+
'entity_id': 'switch.pinecil_animation_loop',
42+
'last_changed': <ANY>,
43+
'last_reported': <ANY>,
44+
'last_updated': <ANY>,
45+
'state': 'on',
46+
})
47+
# ---
48+
# name: test_switch_platform[switch.pinecil_calibrate_cjc-entry]
49+
EntityRegistryEntrySnapshot({
50+
'aliases': set({
51+
}),
52+
'area_id': None,
53+
'capabilities': None,
54+
'config_entry_id': <ANY>,
55+
'device_class': None,
56+
'device_id': <ANY>,
57+
'disabled_by': None,
58+
'domain': 'switch',
59+
'entity_category': <EntityCategory.CONFIG: 'config'>,
60+
'entity_id': 'switch.pinecil_calibrate_cjc',
61+
'has_entity_name': True,
62+
'hidden_by': None,
63+
'icon': None,
64+
'id': <ANY>,
65+
'labels': set({
66+
}),
67+
'name': None,
68+
'options': dict({
69+
}),
70+
'original_device_class': None,
71+
'original_icon': None,
72+
'original_name': 'Calibrate CJC',
73+
'platform': 'iron_os',
74+
'previous_unique_id': None,
75+
'supported_features': 0,
76+
'translation_key': <IronOSSwitch.CALIBRATE_CJC: 'calibrate_cjc'>,
77+
'unique_id': 'c0:ff:ee:c0:ff:ee_calibrate_cjc',
78+
'unit_of_measurement': None,
79+
})
80+
# ---
81+
# name: test_switch_platform[switch.pinecil_calibrate_cjc-state]
82+
StateSnapshot({
83+
'attributes': ReadOnlyDict({
84+
'friendly_name': 'Pinecil Calibrate CJC',
85+
}),
86+
'context': <ANY>,
87+
'entity_id': 'switch.pinecil_calibrate_cjc',
88+
'last_changed': <ANY>,
89+
'last_reported': <ANY>,
90+
'last_updated': <ANY>,
91+
'state': 'on',
92+
})
93+
# ---
94+
# name: test_switch_platform[switch.pinecil_cool_down_screen_flashing-entry]
95+
EntityRegistryEntrySnapshot({
96+
'aliases': set({
97+
}),
98+
'area_id': None,
99+
'capabilities': None,
100+
'config_entry_id': <ANY>,
101+
'device_class': None,
102+
'device_id': <ANY>,
103+
'disabled_by': None,
104+
'domain': 'switch',
105+
'entity_category': <EntityCategory.CONFIG: 'config'>,
106+
'entity_id': 'switch.pinecil_cool_down_screen_flashing',
107+
'has_entity_name': True,
108+
'hidden_by': None,
109+
'icon': None,
110+
'id': <ANY>,
111+
'labels': set({
112+
}),
113+
'name': None,
114+
'options': dict({
115+
}),
116+
'original_device_class': None,
117+
'original_icon': None,
118+
'original_name': 'Cool down screen flashing',
119+
'platform': 'iron_os',
120+
'previous_unique_id': None,
121+
'supported_features': 0,
122+
'translation_key': <IronOSSwitch.COOLING_TEMP_BLINK: 'cooling_temp_blink'>,
123+
'unique_id': 'c0:ff:ee:c0:ff:ee_cooling_temp_blink',
124+
'unit_of_measurement': None,
125+
})
126+
# ---
127+
# name: test_switch_platform[switch.pinecil_cool_down_screen_flashing-state]
128+
StateSnapshot({
129+
'attributes': ReadOnlyDict({
130+
'friendly_name': 'Pinecil Cool down screen flashing',
131+
}),
132+
'context': <ANY>,
133+
'entity_id': 'switch.pinecil_cool_down_screen_flashing',
134+
'last_changed': <ANY>,
135+
'last_reported': <ANY>,
136+
'last_updated': <ANY>,
137+
'state': 'on',
138+
})
139+
# ---
140+
# name: test_switch_platform[switch.pinecil_detailed_idle_screen-entry]
141+
EntityRegistryEntrySnapshot({
142+
'aliases': set({
143+
}),
144+
'area_id': None,
145+
'capabilities': None,
146+
'config_entry_id': <ANY>,
147+
'device_class': None,
148+
'device_id': <ANY>,
149+
'disabled_by': None,
150+
'domain': 'switch',
151+
'entity_category': <EntityCategory.CONFIG: 'config'>,
152+
'entity_id': 'switch.pinecil_detailed_idle_screen',
153+
'has_entity_name': True,
154+
'hidden_by': None,
155+
'icon': None,
156+
'id': <ANY>,
157+
'labels': set({
158+
}),
159+
'name': None,
160+
'options': dict({
161+
}),
162+
'original_device_class': None,
163+
'original_icon': None,
164+
'original_name': 'Detailed idle screen',
165+
'platform': 'iron_os',
166+
'previous_unique_id': None,
167+
'supported_features': 0,
168+
'translation_key': <IronOSSwitch.IDLE_SCREEN_DETAILS: 'idle_screen_details'>,
169+
'unique_id': 'c0:ff:ee:c0:ff:ee_idle_screen_details',
170+
'unit_of_measurement': None,
171+
})
172+
# ---
173+
# name: test_switch_platform[switch.pinecil_detailed_idle_screen-state]
174+
StateSnapshot({
175+
'attributes': ReadOnlyDict({
176+
'friendly_name': 'Pinecil Detailed idle screen',
177+
}),
178+
'context': <ANY>,
179+
'entity_id': 'switch.pinecil_detailed_idle_screen',
180+
'last_changed': <ANY>,
181+
'last_reported': <ANY>,
182+
'last_updated': <ANY>,
183+
'state': 'on',
184+
})
185+
# ---
186+
# name: test_switch_platform[switch.pinecil_detailed_solder_screen-entry]
187+
EntityRegistryEntrySnapshot({
188+
'aliases': set({
189+
}),
190+
'area_id': None,
191+
'capabilities': None,
192+
'config_entry_id': <ANY>,
193+
'device_class': None,
194+
'device_id': <ANY>,
195+
'disabled_by': None,
196+
'domain': 'switch',
197+
'entity_category': <EntityCategory.CONFIG: 'config'>,
198+
'entity_id': 'switch.pinecil_detailed_solder_screen',
199+
'has_entity_name': True,
200+
'hidden_by': None,
201+
'icon': None,
202+
'id': <ANY>,
203+
'labels': set({
204+
}),
205+
'name': None,
206+
'options': dict({
207+
}),
208+
'original_device_class': None,
209+
'original_icon': None,
210+
'original_name': 'Detailed solder screen',
211+
'platform': 'iron_os',
212+
'previous_unique_id': None,
213+
'supported_features': 0,
214+
'translation_key': <IronOSSwitch.SOLDER_SCREEN_DETAILS: 'solder_screen_details'>,
215+
'unique_id': 'c0:ff:ee:c0:ff:ee_solder_screen_details',
216+
'unit_of_measurement': None,
217+
})
218+
# ---
219+
# name: test_switch_platform[switch.pinecil_detailed_solder_screen-state]
220+
StateSnapshot({
221+
'attributes': ReadOnlyDict({
222+
'friendly_name': 'Pinecil Detailed solder screen',
223+
}),
224+
'context': <ANY>,
225+
'entity_id': 'switch.pinecil_detailed_solder_screen',
226+
'last_changed': <ANY>,
227+
'last_reported': <ANY>,
228+
'last_updated': <ANY>,
229+
'state': 'on',
230+
})
231+
# ---
232+
# name: test_switch_platform[switch.pinecil_invert_screen-entry]
233+
EntityRegistryEntrySnapshot({
234+
'aliases': set({
235+
}),
236+
'area_id': None,
237+
'capabilities': None,
238+
'config_entry_id': <ANY>,
239+
'device_class': None,
240+
'device_id': <ANY>,
241+
'disabled_by': None,
242+
'domain': 'switch',
243+
'entity_category': <EntityCategory.CONFIG: 'config'>,
244+
'entity_id': 'switch.pinecil_invert_screen',
245+
'has_entity_name': True,
246+
'hidden_by': None,
247+
'icon': None,
248+
'id': <ANY>,
249+
'labels': set({
250+
}),
251+
'name': None,
252+
'options': dict({
253+
}),
254+
'original_device_class': None,
255+
'original_icon': None,
256+
'original_name': 'Invert screen',
257+
'platform': 'iron_os',
258+
'previous_unique_id': None,
259+
'supported_features': 0,
260+
'translation_key': <IronOSSwitch.DISPLAY_INVERT: 'display_invert'>,
261+
'unique_id': 'c0:ff:ee:c0:ff:ee_display_invert',
262+
'unit_of_measurement': None,
263+
})
264+
# ---
265+
# name: test_switch_platform[switch.pinecil_invert_screen-state]
266+
StateSnapshot({
267+
'attributes': ReadOnlyDict({
268+
'friendly_name': 'Pinecil Invert screen',
269+
}),
270+
'context': <ANY>,
271+
'entity_id': 'switch.pinecil_invert_screen',
272+
'last_changed': <ANY>,
273+
'last_reported': <ANY>,
274+
'last_updated': <ANY>,
275+
'state': 'on',
276+
})
277+
# ---
278+
# name: test_switch_platform[switch.pinecil_pps_epr_pd_mode-entry]
279+
EntityRegistryEntrySnapshot({
280+
'aliases': set({
281+
}),
282+
'area_id': None,
283+
'capabilities': None,
284+
'config_entry_id': <ANY>,
285+
'device_class': None,
286+
'device_id': <ANY>,
287+
'disabled_by': None,
288+
'domain': 'switch',
289+
'entity_category': <EntityCategory.CONFIG: 'config'>,
290+
'entity_id': 'switch.pinecil_pps_epr_pd_mode',
291+
'has_entity_name': True,
292+
'hidden_by': None,
293+
'icon': None,
294+
'id': <ANY>,
295+
'labels': set({
296+
}),
297+
'name': None,
298+
'options': dict({
299+
}),
300+
'original_device_class': None,
301+
'original_icon': None,
302+
'original_name': 'PPS & EPR PD mode',
303+
'platform': 'iron_os',
304+
'previous_unique_id': None,
305+
'supported_features': 0,
306+
'translation_key': <IronOSSwitch.USB_PD_MODE: 'usb_pd_mode'>,
307+
'unique_id': 'c0:ff:ee:c0:ff:ee_usb_pd_mode',
308+
'unit_of_measurement': None,
309+
})
310+
# ---
311+
# name: test_switch_platform[switch.pinecil_pps_epr_pd_mode-state]
312+
StateSnapshot({
313+
'attributes': ReadOnlyDict({
314+
'friendly_name': 'Pinecil PPS & EPR PD mode',
315+
}),
316+
'context': <ANY>,
317+
'entity_id': 'switch.pinecil_pps_epr_pd_mode',
318+
'last_changed': <ANY>,
319+
'last_reported': <ANY>,
320+
'last_updated': <ANY>,
321+
'state': 'on',
322+
})
323+
# ---
324+
# name: test_switch_platform[switch.pinecil_swap_buttons-entry]
325+
EntityRegistryEntrySnapshot({
326+
'aliases': set({
327+
}),
328+
'area_id': None,
329+
'capabilities': None,
330+
'config_entry_id': <ANY>,
331+
'device_class': None,
332+
'device_id': <ANY>,
333+
'disabled_by': None,
334+
'domain': 'switch',
335+
'entity_category': <EntityCategory.CONFIG: 'config'>,
336+
'entity_id': 'switch.pinecil_swap_buttons',
337+
'has_entity_name': True,
338+
'hidden_by': None,
339+
'icon': None,
340+
'id': <ANY>,
341+
'labels': set({
342+
}),
343+
'name': None,
344+
'options': dict({
345+
}),
346+
'original_device_class': None,
347+
'original_icon': None,
348+
'original_name': 'Swap +/- buttons',
349+
'platform': 'iron_os',
350+
'previous_unique_id': None,
351+
'supported_features': 0,
352+
'translation_key': <IronOSSwitch.INVERT_BUTTONS: 'invert_buttons'>,
353+
'unique_id': 'c0:ff:ee:c0:ff:ee_invert_buttons',
354+
'unit_of_measurement': None,
355+
})
356+
# ---
357+
# name: test_switch_platform[switch.pinecil_swap_buttons-state]
358+
StateSnapshot({
359+
'attributes': ReadOnlyDict({
360+
'friendly_name': 'Pinecil Swap +/- buttons',
361+
}),
362+
'context': <ANY>,
363+
'entity_id': 'switch.pinecil_swap_buttons',
364+
'last_changed': <ANY>,
365+
'last_reported': <ANY>,
366+
'last_updated': <ANY>,
367+
'state': 'on',
368+
})
369+
# ---

0 commit comments

Comments
 (0)