@@ -156,6 +156,9 @@ class ConnectAttempt(NamedTuple):
156
156
"device_id" : lambda x : "REDACTED_" + x [9 ::],
157
157
"owner" : lambda x : "REDACTED_" + x [9 ::],
158
158
"mac" : mask_mac ,
159
+ "master_device_id" : lambda x : "REDACTED_" + x [9 ::],
160
+ "group_id" : lambda x : "REDACTED_" + x [9 ::],
161
+ "group_name" : lambda x : "I01BU0tFRF9TU0lEIw==" ,
159
162
}
160
163
161
164
@@ -643,7 +646,11 @@ def _get_device_class(info: dict) -> type[Device]:
643
646
"""Find SmartDevice subclass for device described by passed data."""
644
647
if "result" in info :
645
648
discovery_result = DiscoveryResult .from_dict (info ["result" ])
646
- https = discovery_result .mgt_encrypt_schm .is_support_https
649
+ https = (
650
+ discovery_result .mgt_encrypt_schm .is_support_https
651
+ if discovery_result .mgt_encrypt_schm
652
+ else False
653
+ )
647
654
dev_class = get_device_class_from_family (
648
655
discovery_result .device_type , https = https
649
656
)
@@ -747,7 +754,13 @@ def _get_device_instance(
747
754
)
748
755
749
756
type_ = discovery_result .device_type
750
- encrypt_schm = discovery_result .mgt_encrypt_schm
757
+ if (encrypt_schm := discovery_result .mgt_encrypt_schm ) is None :
758
+ raise UnsupportedDeviceError (
759
+ f"Unsupported device { config .host } of type { type_ } "
760
+ "with no mgt_encrypt_schm" ,
761
+ discovery_result = discovery_result .to_dict (),
762
+ host = config .host ,
763
+ )
751
764
752
765
try :
753
766
if not (encrypt_type := encrypt_schm .encrypt_type ) and (
@@ -765,13 +778,13 @@ def _get_device_instance(
765
778
config .connection_type = DeviceConnectionParameters .from_values (
766
779
type_ ,
767
780
encrypt_type ,
768
- discovery_result . mgt_encrypt_schm .lv ,
769
- discovery_result . mgt_encrypt_schm .is_support_https ,
781
+ encrypt_schm .lv ,
782
+ encrypt_schm .is_support_https ,
770
783
)
771
784
except KasaException as ex :
772
785
raise UnsupportedDeviceError (
773
786
f"Unsupported device { config .host } of type { type_ } "
774
- + f"with encrypt_type { discovery_result . mgt_encrypt_schm .encrypt_type } " ,
787
+ + f"with encrypt_type { encrypt_schm .encrypt_type } " ,
775
788
discovery_result = discovery_result .to_dict (),
776
789
host = config .host ,
777
790
) from<
8000
/span> ex
@@ -854,7 +867,7 @@ class DiscoveryResult(_DiscoveryBaseMixin):
854
867
device_id : str
855
868
ip : str
856
869
mac : str
857
- mgt_encrypt_schm : EncryptionScheme
870
+ mgt_encrypt_schm : EncryptionScheme | None = None
858
871
device_name : str | None = None
859
872
encrypt_info : EncryptionInfo | None = None
860
873
encrypt_type : list [str ] | None = None
0 commit comments