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

HASS Discovery - Create BLE devices automatically to gather entities #826

Merged
merged 9 commits into from
Dec 22, 2020

Conversation

titilambert
Copy link
Contributor

As discuted here: #821

Note that I'm not so good with C++, so I guess the code it's no so clean ...

@titilambert
Copy link
Contributor Author

Is there any way to fmt the code with a command line ? (like go fmt )

@Legion2
Copy link
Contributor

Legion2 commented Dec 5, 2020

clang-Format is used for code formatting

@titilambert
Copy link
Contributor Author

Ready for review
Again, I guess my code is not so clean, I'm not familiar with C++

@1technophile 1technophile self-requested a review December 6, 2020 18:13
Copy link
Owner

@1technophile 1technophile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a first list of comments

main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/config_mqttDiscovery.h Outdated Show resolved Hide resolved
@aswarcewicz
Copy link

Is it possible to include change in 0.9.6 milestone?

main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayBT.ino Outdated Show resolved Hide resolved
main/ZgatewayRF.ino Show resolved Hide resolved
main/ZmqttDiscovery.ino Outdated Show resolved Hide resolved
main/ZmqttDiscovery.ino Outdated Show resolved Hide resolved
main/ZmqttDiscovery.ino Outdated Show resolved Hide resolved
@1technophile 1technophile added this to the v0.9.6 milestone Dec 9, 2020
@titilambert titilambert force-pushed the improve_hass branch 3 times, most recently from ee10ff6 to a06b4a8 Compare December 10, 2020 03:13
@titilambert
Copy link
Contributor Author

@1technophile thanks again for reviewing the PR !
Hopefully, I'm close to get it done !

@titilambert
Copy link
Contributor Author

@1technophile the following line

(char*)String(p->sensorModel).c_str()

return a number (in my case 7). I guess it's the index in ble_sensor_model.
How can I get the good string instead ?

@Legion2
Copy link
Contributor

Legion2 commented Dec 10, 2020

The number is the pointer to the string in the memory, C and C++ do not have string as a native type.

@1technophile
Copy link
Owner

1technophile commented Dec 10, 2020

How can I get the good string instead ?

Well, indeed this return an int ...

I think we may store the sensor characteristics (model, manufacturer,code) in a dedicated list.
I can do it in a separate PR, for the moment you can put the sensor model hardcoded.

@1technophile 1technophile changed the title Improve hass HASS Discovery - Create BLE devices automatically to gather entities Dec 11, 2020
@1technophile
Copy link
Owner

1technophile commented Dec 13, 2020

Once your changes are done we will need to rebase this PR = merge the changes from the development branch to this PR ( I can do it if needed).

@1technophile
Copy link
Owner

Hi @titilambert , would you have time to finish the PR?

@titilambert
Copy link
Contributor Author

@1technophile sorry ! It's done and rebased

@1technophile
Copy link
Owner

No problem ! Thanks

@titilambert
Copy link
Contributor Author

@1technophile any idea why the build crashes ?

@1technophile
Copy link
Owner

1technophile commented Dec 19, 2020

@titilambert You can take a look below (search for FAILED):
https://github.com/1technophile/OpenMQTTGateway/runs/1574425197?check_suite_focus=true

Some createDiscovery functions are missing the 4 new parameters:
"", "", "", "" // device name, device manufacturer, device model, device mac

This is related to the rebasing/merge and seems isolated to M5 boards.

@titilambert
Copy link
Contributor Author

@titilambert You can take a look below (search for FAILED):
https://github.com/1technophile/OpenMQTTGateway/runs/1574425197?check_suite_focus=true

Some createDiscovery functions are missing the 4 new parameters:
"", "", "", "" // device name, device manufacturer, device model, device mac

This is related to the rebasing/merge and seems isolated to M5 boards.

Sorry I don't see where it is in the code.
Can you help ?

@1technophile
Copy link
Owner

Can you help ?

@titilambert of course, here is how to find it:
image

@1technophile
Copy link
Owner

Test ok with HASS 2020.12.7
image

Note that I had to restart HASS

@1technophile 1technophile merged commit 0c01ded into 1technophile:development Dec 22, 2020
@1technophile
Copy link
Owner

Thanks!

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.

4 participants