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

Update delete methods in daos #2593

Merged
merged 2 commits into from
Jun 14, 2022
Merged

Conversation

NotWoods
Copy link
Contributor

@NotWoods NotWoods commented Jun 7, 2022

Summary

Some additional work to make Dao methods run non-blocking using coroutines. Converted some methods to use coroutines and removed some unused methods.

Comment on lines -79 to +84
for (setting in allSettings) {
if (setting.value == "")
sensorDao.removeSetting(lastUpdate.id, setting.name)

val settingsToRemove = allSettings
.filter { setting -> setting.value == "" }
.map { setting -> setting.name }
if (settingsToRemove.isNotEmpty()) {
sensorDao.removeSettings(lastUpdate.id, settingsToRemove)
Copy link
Contributor

@marazmarci marazmarci Jun 8, 2022

Choose a reason for hiding this comment

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

This change will cause a conflict with my open PR: #2585 Fix removing non-last list items from Last Update Trigger sensor's settings

See these lines in my changes.

We should decide on who and how to resolve it.
I think it would be easier to solve the conflict in your PR because I have several smaller commits which would be harder to rebase. And my PR is already reviewed (but not yet formally approved) by one person (@jpelgrom).

@JBassett JBassett merged commit c5b0215 into home-assistant:master Jun 14, 2022
@NotWoods NotWoods deleted the dao-deleting branch June 14, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants