File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from collections .abc import Callable
4
4
from enum import Enum
5
+ import inspect
5
6
import math
7
+ import pathlib
8
+ from types import FrameType
6
9
from typing import Any , Optional
7
10
8
11
from zigpy .quirks import _DEVICE_REGISTRY
@@ -185,6 +188,12 @@ def __init__(
185
188
self .tuya_dp_to_attribute : dict [int , DPToAttributeMapping ] = {}
186
189
self .new_attributes : set [foundation .ZCLAttributeDef ] = set ()
187
190
super ().__init__ (manufacturer , model , registry )
191
+ # quirk_file will point to the init call above if called from this QuirkBuilder,
192
+ # so we need to re-set it correctly
193
+ current_frame : FrameType = inspect .currentframe ()
194
+ caller : FrameType = current_frame .f_back
195
+ self .quirk_file = pathlib .Path (caller .f_code .co_filename )
196
+ self .quirk_file_line = caller .f_lineno
188
197
189
198
def _tuya_battery (
190
199
self ,
You can’t perform that action at this time.
0 commit comments