- 
                Notifications
    
You must be signed in to change notification settings  - Fork 902
 
Add Third Reality curtain_gen1 settings #4378
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
          
     Draft
      
      
            3reality-support
  wants to merge
  34
  commits into
  zigpy:dev
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
3reality-support:curtain_g1
  
      
      
   
  
    
  
  
  
 
  
      
    base: dev
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Draft
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            34 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      c07c896
              
                add 3r project py
              
              
                jintj 138ae97
              
                [pre-commit.ci] auto fixes from pre-commit.com hooks
              
              
                pre-commit-ci[bot] ef0efaa
              
                 update
              
              
                jintj 0148d86
              
                update
              
              
                jintj 20f777e
              
                update
              
              
                jintj 0e87d69
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 126ecd8
              
                update button tes
              
              
                jintj 36eee8f
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 2cc011f
              
                update
              
              
                jintj b4cdbf6
              
                Merge branch 'master' of https://github.com/3reality-support/zha-devi…
              
              
                jintj 89e80cb
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 115e9e4
              
                Update test_third_button.py
              
              
                3reality-support b484bc7
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] c798a96
              
                Update test_third_button.py
              
              
                3reality-support 88c9847
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 4f74b2e
              
                Update test_third_button.py
              
              
                3reality-support e25a838
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] e275a43
              
                Update test_third_button.py
              
              
                3reality-support c5b8f9a
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 86ac6c4
              
                Update test_third_button.py
              
              
                3reality-support 44748cb
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 4a8b815
              
                Update test_third_button.py
              
              
                3reality-support 58b6ed2
              
                Update test_third_button.py
              
              
                3reality-support b95f82c
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 9f0034f
              
                Update test_third_button.py
              
              
                3reality-support cfd1145
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] 63a1b15
              
                Update test_third_button.py
              
              
                3reality-support 60447b7
              
                update
              
              
                jintj 26a4356
              
                Merge branch 'dev' into master
              
              
                3reality-support 8c1b51b
              
                update
              
              
                jintj e5190e0
              
                update
              
              
                jintj b1755ae
              
                update
              
              
                jintj ea9535e
              
                Apply pre-commit auto fixes
              
              
                pre-commit-ci[bot] e5832c3
              
                Update curtain_gen1.py
              
              
                3reality-support File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| """Third Reality curtain devices.""" | ||
| 
     | 
||
| from typing import Final | ||
| 
     | 
||
| from zigpy.quirks import CustomCluster | ||
| from zigpy.quirks.v2 import QuirkBuilder | ||
| import zigpy.types as t | ||
| from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef | ||
| 
     | 
||
| 
     | 
||
| class ThirdRealityCurtainCluster(CustomCluster): | ||
| """Third Reality's curtain private cluster.""" | ||
| 
     | 
||
| cluster_id = 0xFFF1 | ||
| 
     | 
||
| class AttributeDefs(BaseAttributeDefs): | ||
| """Define the attributes of a private cluster.""" | ||
| 
     | 
||
| enable_disable_pir_remote: Final = ZCLAttributeDef( | ||
| id=0x0000, | ||
| type=t.uint8_t, | ||
| is_manufacturer_specific=True, | ||
| ) | ||
| 
     | 
||
| allow_bind: Final = ZCLAttributeDef( | ||
| id=0x0020, | ||
| type=t.uint8_t, | ||
| is_manufacturer_specific=True, | ||
| ) | ||
| 
     | 
||
| 
     | 
||
| ( | ||
| QuirkBuilder("Third Reality, Inc", "3RSB015BZ") | ||
| .replaces(ThirdRealityCurtainCluster) | ||
| .switch( | ||
| attribute_name=ThirdRealityCurtainCluster.AttributeDefs.enable_disable_pir_remote.name, | ||
| cluster_id=ThirdRealityCurtainCluster.cluster_id, | ||
| force_inverted=True, | ||
| translation_key="enable_pir_mode", | ||
| fallback_name="Enable PIR remote", | ||
| ) | ||
| .write_attr_button( | ||
| attribute_name=ThirdRealityCurtainCluster.AttributeDefs.allow_bind.name, | ||
| attribute_value=0x01, | ||
| cluster_id=ThirdRealityCurtainCluster.cluster_id, | ||
| translation_key="allow_bind", | ||
| fallback_name="Allow bind", | ||
| ) | ||
| .add_to_registry() | ||
| ) | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "Allow bind" do exactly? Is this related to cluster binding or to curtains being bound?
Does the device reset the value from
1to0itself after this button is pressed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After writing 1, wait for 3 minutes until the end, and this value will become 0