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

Fix UI issue #88

Merged
merged 4 commits into from
Mar 24, 2024
Merged

Fix UI issue #88

merged 4 commits into from
Mar 24, 2024

Conversation

raman325
Copy link
Owner

Breaking change

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

@github-actions github-actions bot added bug Something isn't working javascript Pull requests that update javascript code python Pull requests that update Python code labels Mar 18, 2024
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 89.82%. Comparing base (498888b) to head (dd2b447).
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
- Coverage   89.90%   89.82%   -0.08%     
==========================================
  Files          19       19              
  Lines        1208     1209       +1     
==========================================
  Hits         1086     1086              
- Misses        122      123       +1     
Files Coverage Δ
custom_components/lock_code_manager/__init__.py 97.00% <100.00%> (+0.01%) ⬆️
...components/lock_code_manager/providers/zwave_js.py 37.14% <0.00%> (-0.96%) ⬇️

@raman325
Copy link
Owner Author

@tykeal do you mind testing this PR? Trying to figure out where the issue is, and as far as I can tell it's a timing issue but I can't quite be sure

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

I'll give it a try in the morning. I'm nowhere near my test system right now

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

@raman325 Well, it loads, unlike what I was seeing with 0.4.0. Everything is showing as unavailable though. I removed the configuration, added it back in and then when to look at the dashboard and everything was showing as available when I first got to it but shortly after it showed everything as unavailable again.

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

I enabled debug for the component and here's all the spew for my test system related to LCM

2024-03-22 06:09:49.318 DEBUG (MainThread) [custom_components.lock_code_manager] Exposed strategy module at /lock_code_manager_files/lock-code-manager-strategy.js
2024-03-22 06:09:49.318 DEBUG (MainThread) [custom_components.lock_code_manager] Strategy module already registered with resource ID 4102097731c84b69898804e97e5fccee
2024-03-22 06:09:49.318 DEBUG (MainThread) [custom_components.lock_code_manager] Finished setting up websocket API
2024-03-22 06:09:49.332 INFO (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Creating and/or updating entities
2024-03-22 06:09:49.354 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding following locks: ['lock.test_lock']
2024-03-22 06:09:49.354 DEBUG (MainThread) [custom_components.lock_code_manager.helpers] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Created lock instance ZWaveJSLock(domain=zwave_js, lock=lock.test_lock)
2024-03-22 06:09:49.354 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Creating lock instance for lock ZWaveJSLock(domain=zwave_js, lock=lock.test_lock)
2024-03-22 06:09:49.354 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Creating coordinator for lock ZWaveJSLock(domain=zwave_js, lock=lock.test_lock)
2024-03-22 06:09:49.355 DEBUG (MainThread) [custom_components.lock_code_manager.coordinator] Finished fetching lock_code_manager lock.test_lock data in 0.000 seconds (success: True)
2024-03-22 06:09:49.355 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding lock lock.test_lock slot 1 sensor and event entity
2024-03-22 06:09:49.355 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity sensor.test_lock_code_slot_1
2024-03-22 06:09:49.356 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding lock lock.test_lock slot 2 sensor and event entity
2024-03-22 06:09:49.356 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.test_lock_code_slot_2_in_sync
2024-03-22 06:09:49.356 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity sensor.test_lock_code_slot_2
2024-03-22 06:09:49.357 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding lock lock.test_lock slot 3 sensor and event entity
2024-03-22 06:09:49.357 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.test_lock_code_slot_3_in_sync
2024-03-22 06:09:49.358 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity sensor.test_lock_code_slot_3
2024-03-22 06:09:49.358 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding PIN enabled binary sensor for slot 1
2024-03-22 06:09:49.358 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.foo_code_slot_1_active
2024-03-22 06:09:49.359 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity event.foo_code_slot_1
2024-03-22 06:09:49.359 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_1_name
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_1_pin
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity switch.foo_code_slot_1_enabled
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Sending signal from switch.foo_code_slot_1_enabled to binary sensor that slot 1 is ready
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding enabled entity for slot 1
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding name entity for slot 1
2024-03-22 06:09:49.361 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin entity for slot 1
2024-03-22 06:09:49.362 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin_used entity for slot 1
2024-03-22 06:09:49.362 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding PIN enabled binary sensor for slot 2
2024-03-22 06:09:49.362 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.foo_code_slot_2_active
2024-03-22 06:09:49.362 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity event.foo_code_slot_2
2024-03-22 06:09:49.363 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_2_name
2024-03-22 06:09:49.363 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_2_pin
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity switch.foo_code_slot_2_enabled
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Sending signal from switch.foo_code_slot_2_enabled to binary sensor that slot 2 is ready
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding enabled entity for slot 2
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding name entity for slot 2
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin entity for slot 2
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin_used entity for slot 2
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding PIN enabled binary sensor for slot 3
2024-03-22 06:09:49.364 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.foo_code_slot_3_active
2024-03-22 06:09:49.365 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity event.foo_code_slot_3
2024-03-22 06:09:49.365 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_3_name
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity text.foo_code_slot_3_pin
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity switch.foo_code_slot_3_enabled
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Sending signal from switch.foo_code_slot_3_enabled to binary sensor that slot 3 is ready
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding enabled entity for slot 3
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding name entity for slot 3
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin entity for slot 3
2024-03-22 06:09:49.366 DEBUG (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding pin_used entity for slot 3
2024-03-22 06:09:49.366 INFO (MainThread) [custom_components.lock_code_manager] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Done creating and/or updating entities
2024-03-22 06:09:49.394 DEBUG (MainThread) [custom_components.lock_code_manager.coordinator] Finished fetching lock_code_manager lock.test_lock data in 0.000 seconds (success: True)
2024-03-22 06:09:49.397 DEBUG (MainThread) [custom_components.lock_code_manager.binary_sensor] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Updating binary_sensor.foo_code_slot_1_active
2024-03-22 06:09:49.397 DEBUG (MainThread) [custom_components.lock_code_manager.binary_sensor] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Updating binary_sensor.foo_code_slot_2_active
2024-03-22 06:09:49.398 DEBUG (MainThread) [custom_components.lock_code_manager.binary_sensor] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Updating binary_sensor.foo_code_slot_3_active
2024-03-22 06:09:49.416 DEBUG (MainThread) [custom_components.lock_code_manager.entity] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Adding entity binary_sensor.test_lock_code_slot_1_in_sync

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

I then see a few more updates after I captured that with the following:

2024-03-22 06:10:49.148 DEBUG (MainThread) [custom_components.lock_code_manager.binary_sensor] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Updating binary_sensor.foo_code_slot_2_active
2024-03-22 06:10:49.152 DEBUG (MainThread) [custom_components.lock_code_manager.binary_sensor] 73bd631cc6ba05c96f7aec7ec67a2177 (Foo): Updating binary_sensor.foo_code_slot_3_active
2024-03-22 06:10:49.158 DEBUG (MainThread) [custom_components.lock_code_manager.coordinator] Finished fetching lock_code_manager lock.test_lock data in 0.001 seconds (success: True)
2024-03-22 06:11:49.158 DEBUG (MainThread) [custom_components.lock_code_manager.coordinator] Finished fetching lock_code_manager lock.test_lock data in 0.001 seconds (success: True)

Which looks pretty standard but the entities all remain unavailable to me.

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

:-/ ok, looks like my zwave lock is showing up as unavailable in HA for some reason even though ZWave-JS is showing it as active. So that will probably explain my unavailable entities. Let me figure out my test bed problem

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

Right.... that's great. I knew this lock was having issues which is why I removed it from active service. Now the Zwave has gone flaky on me 😆 I've got a spare lock for use on my properties if one of the locks fails suddenly. I guess I'll hook that up to my test instance.

@tykeal
Copy link
Contributor

tykeal commented Mar 22, 2024

Given what I'm seeing I believe this will fix #98

@raman325 raman325 merged commit e20935b into main Mar 24, 2024
7 of 9 checks passed
@raman325 raman325 deleted the fix branch March 24, 2024 00:26
@raman325 raman325 linked an issue Mar 24, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update javascript code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ISSUE] 0.4.0 breaks adding a lock
2 participants