-
Notifications
You must be signed in to change notification settings - Fork 176
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 #10000
draft #10000
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #10000 +/- ##
==========================================
+ Coverage 74.74% 74.75% +0.01%
==========================================
Files 2110 2110
Lines 55429 55470 +41
Branches 5630 5630
==========================================
+ Hits 41429 41466 +37
- Misses 12866 12870 +4
Partials 1134 1134
Flags with carried forward coverage won't be shown. Click here to find out 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.
I think the structure is good, but theres some little things and you should refactor the parts that send the messages so it's harder to accidentally specify the wrong sensor
@@ -146,6 +146,9 @@ class MoveCompletedPayload(MoveGroupResponsePayload): | |||
ack_id: utils.UInt8Field | |||
|
|||
|
|||
# maybe write a set sync message |
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 would a set sync message be?
), | ||
) | ||
|
||
while True: |
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.
Definitely don't want to do this like this:
- shouldn't have a function that has an infinite loop with no break condition - there should always be something.
- lines 87 to 94 will lock this program - this is an async function and
read()
is a synchronous call, so the loop won't be able to spin.
) | ||
|
||
while True: | ||
read_data = self.read( |
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 actually that second thing might just be that this needs to be an await self.read(...
but the first thing is true
node_id=node_id, | ||
message=BindSensorOutputRequest( | ||
payload=BindSensorOutputRequestPayload( | ||
sensor=SensorTypeField(SensorType.capacitive), |
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.
pressure?
node_id=node_id, | ||
message=BaselineSensorRequest( | ||
payload=BaselineSensorRequestPayload( | ||
sensor=SensorTypeField(SensorType.capacitive), |
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.
pressure
@classmethod | ||
def build(cls, data): # type: ignore[no-untyped-def] | ||
"""Build function for sensor data type.""" | ||
if isinstance(data, list): | ||
backing = Int32Field(cls._convert_to_int(data)) | ||
elif isinstance(data, Int32Field): | ||
# breakpoint() |
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.
delete
592b7d6
to
dc23391
Compare
draft pr for sync binding function and tests
also number 10000 WOOOOO 🍾🍾🍾🍾
🎉🎉🎉 🎊🎊
🎉🎉🎉🎉🎊