-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Add sensors for switchbot cloud integration #147663
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
base: dev
Are you sure you want to change the base?
Conversation
Hey there @SeraphicRav, @laurence-presland, @Gigatrappeur, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
LIGHTLEVEL_DESCRIPTION = SensorEntityDescription( | ||
key="lightLevel", | ||
translation_key="light_level", | ||
native_unit_of_measurement="Level", |
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.
Please use a translatable unit of measurement
icon="mdi:door", | ||
translation_key="contact_open", | ||
device_class=SensorDeviceClass.ENUM, | ||
options=["open", "closed", "timeout"], |
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 is timeout for?
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.
api return 3 kinds of status as below
the open state of the sensor. open, close, or timeOutNotClose
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.
When does that last thing happen?
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.
This means that the sensor detected that the door opening time was too long and failed to detect the door closing within the threshold time range set by the firmware.
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.
Hmm, do we get updates for this via the webhook?
I kinda think that exposing a door state as a binary sensor makes more sense as we can use the device class to tell home assistant its genuinely a door (which is nicer with automating).
But then I'm looking for the best way to show this extra state, maybe an event entity
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.
you mean map the timeout status to unknown? it may confuse users, Actual the door is open
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.
Oh if that's the case we can set the door to open indeed.
Would that other state happen often and what should the user do to fix it?
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.
This status is to remind the user that the door has not been closed. The user can actively set the time interval, that is, after opening the door, the door has not been closed after the set time
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.
Maybe it can be a separate binary sensor
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.
sure
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
"name": "Light level" | ||
}, | ||
"contact_open": { | ||
"name": "Contact open", |
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.
If the states can be "open" and "closed", why is it named "Contact open"?
"open": "Open", | ||
"closed": "Closed", |
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.
Can be replaced with common states:
"open": "Open", | |
"closed": "Closed", | |
"open": "[%key:common::state::open%]", | |
"closed": "[%key:common::state::closed%]", |
Breaking change
Proposed change
Add sensors for switchbot integration
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: