File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,13 @@ def initialize_message(self):
156156 self .state_topic = f'{ topic_root } /{ self .sensorType } /{ self .deviceId } /state'
157157 self .unique_id = f'{ self .deviceId } _sensor_{ self .sensorName } '
158158
159+ if self .mac != "" :
160+ connections_snippet = [
161+ ["mac" , self .mac ]
162+ ]
163+ else :
164+ connections_snippet = []
165+
159166 # Update the message dictionary, expanding it without overwriting
160167 self .message .update ({
161168 "name" : self .sensorName ,
@@ -166,9 +173,7 @@ def initialize_message(self):
166173 "identifiers" : [f"{ self .deviceId } _sensor" ],
167174 "manufacturer" : "NetAlertX" ,
168175 "name" : self .deviceName ,
169- "connections" : [
170- ["mac" , self .mac ]
171- ],
176+ "connections" : connections_snippet
172177 },
173178 "icon" : f'mdi:{ self .icon } '
174179 })
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ Enable **Generate Fake MAC** when the API does not expose MAC addresses (e.g. re
4848
4949### Example: OPNsense Dnsmasq API
5050
51- See the [ OPNsense configuration guide] ( https://docs.netalertx.com/PLUGINS ) for details.
51+ See the [ OPNsense configuration guide] ( https://docs.netalertx.com/REST_IMPORT ) for details.
5252
5353** Response:**
5454``` json
You can’t perform that action at this time.
0 commit comments