Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISC] auto-discovery strcmp instead of substring only strstr #1968

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

DigiH
Copy link
Collaborator

@DigiH DigiH commented Jun 12, 2024

To avoid auto-discovery issues due to substring comparison at
https://github.com/1technophile/OpenMQTTGateway/blob/development/main/ZgatewayRTL_433.ino#L128

strcmp instead of substring only strstr

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

@DigiH DigiH requested a review from 1technophile June 12, 2024 23:04
@DigiH DigiH changed the title [DISC] reorder UVI for correct auto-discovery [DISC] auto-discovery strcmp instead of substring only strstr Jun 13, 2024
To avoid auto-discovery issues due to substring comparison at
https://github.com/1technophile/OpenMQTTGateway/blob/development/main/ZgatewayRTL_433.ino#L128

strcmp instead of substring only strstr
@DigiH
Copy link
Collaborator Author

DigiH commented Jun 13, 2024

@riegelbrau

Could you check if this change from strstr to strcmp makes any difference to your TPMS Jansite-Solar fix at all.

It shouldn't really, but best to double check.

@riegelbrau
Copy link
Contributor

riegelbrau commented Jun 14, 2024

I copied the changed code into my platformio workspace with the actual development branch, compiled and tested the creation of my TPMS sensor. It's still working as expected!

{
	"stat_t": "+/+/RTL_433toMQTT/TPMS/Jansite-Solar/5e512a",
	"dev_cla": "temperature",
	"unit_of_meas": "°C",
	"name": "Temperature",
	"uniq_id": "TPMS-Jansite-Solar-5e512a-temperature_C",
	"val_tpl": "{{ value_json.temperature_C }}",
	"state_class": "measurement",
	"device": {
		"ids": [
			"TPMS-Jansite-Solar-5e512a"
		],
		"cns": [
			[
				"mac",
				"TPMS-Jansite-Solar-5e512a"
			]
		],
		"mdl": "Jansite-Solar",
		"name": "TPMS-Jansite-Solar-5e512a",
		"via_device": "OMG_lilygo_rtl_433_ESP_OOK_CBTEST"
	}
}

@DigiH
Copy link
Collaborator Author

DigiH commented Jun 14, 2024

Thanks for the testing and confirmation @riegelbrau

@1technophile
Copy link
Owner

Thanks

@1technophile 1technophile merged commit 4bb7c55 into development Jun 17, 2024
146 checks passed
@1technophile 1technophile deleted the uvi branch June 17, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants