Skip to content

Commit

Permalink
looks like we can get device_id as {}
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Sep 2, 2024
1 parent b821e69 commit c23e0d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Modules/pluginModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def plugin_self_identifier( self, model, manufacturer):


def check_found_plugin_model( self, model, manufacturer_name=None, manufacturer_code=None, device_id=None):
self.log.logging( "Pairing", "Debug", "check_found_plugin_model - %s %s %s %s" % (
model, manufacturer_name, manufacturer_code, device_id))
self.log.logging( "Pairing", "Debug", f"check_found_plugin_model - model={model}, manufacturer_name={manufacturer_name}, manufacturer_code={manufacturer_code}, device_id={device_id}")

if device_id == {}:
device_id = None
device_id = None if device_id == {} else device_id
manufacturer_name = None if manufacturer_name == {} else manufacturer_name
manufacturer_code = None if manufacturer_code == {} else manufacturer_code

# Let's check if
for x in PLUGIN_MODELS_MATRIX:
Expand Down
1 change: 0 additions & 1 deletion Modules/readClusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
decode_vibrAngle, readLumiLock, readXiaomiCluster,
store_lumi_attribute)
from Modules.philips import philips_dimmer_switch
from Modules.pluginModels import check_found_plugin_model
from Modules.readZclClusters import (is_cluster_zcl_config_available,
process_cluster_attribute_response)
from Modules.schneider_wiser import (receiving_heatingdemand_attribute,
Expand Down
8 changes: 7 additions & 1 deletion Modules/zclClusterHelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,17 @@ def _upd_data_strut_based_on_model(self, MsgSrcAddr, modelName, initial_ep):


def _build_model_name( self, nwkid, modelName):


self.log.logging([ "ZclClusters", "Pairing"], "Debug", f"_build_model_name {modelName}", nwkid)

manufacturer_name = self.ListOfDevices[nwkid].get("Manufacturer Name", "")
manuf_code = self.ListOfDevices[nwkid].get("Manufacturer", "")
zdevice_id = self.ListOfDevices[nwkid].get("ZDeviceID", None)

self.log.logging([ "ZclClusters", "Pairing"], "Debug", f"_build_model_name manufacturer_name: {manufacturer_name}", nwkid)
self.log.logging([ "ZclClusters", "Pairing"], "Debug", f"_build_model_name manuf_code: {manuf_code}", nwkid)
self.log.logging([ "ZclClusters", "Pairing"], "Debug", f"_build_model_name zdevice_id: {zdevice_id}", nwkid)

if modelName in ( '66666', ):
# https://github.com/Koenkk/zigbee2mqtt/issues/4338
return check_found_plugin_model( self, modelName, manufacturer_name=manufacturer_name, manufacturer_code=manuf_code, device_id=zdevice_id)
Expand Down

0 comments on commit c23e0d5

Please sign in to comment.