Skip to content

YoLink Power Failure Alarm#91934

Merged
emontnemery merged 5 commits into
home-assistant:devfrom
YoSmart-Inc:ys_powerfailure_alarm
May 25, 2023
Merged

YoLink Power Failure Alarm#91934
emontnemery merged 5 commits into
home-assistant:devfrom
YoSmart-Inc:ys_powerfailure_alarm

Conversation

@matrixd2
Copy link
Copy Markdown
Contributor

@matrixd2 matrixd2 commented Apr 24, 2023

Proposed change

Add YoLink Power Failured Alarm(YS7106) Support

YoLink API changes
YoSmart-Inc/yolink-api@v0.2.8...v0.2.9

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@gjohansson-ST
Copy link
Copy Markdown
Member

Please add a a link to the changelog, or at minimum a diff between library versions to the PR description

@matrixd2
Copy link
Copy Markdown
Contributor Author

matrixd2 commented May 5, 2023

@gjohansson-ST Thanks, The description has been updated

YoLinkSensorEntityDescription(
key="state",
device_class=SensorDeviceClass.ENUM,
name="State",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems like a vague name, maybe name it "Power failure alarm"?

YoLinkSensorEntityDescription(
key="mute",
device_class=SensorDeviceClass.ENUM,
name="Mute",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above about this possibly being too vague

icon="mdi:volume-mute",
options=["yes", "no"],
exists_fn=lambda device: device.device_type in ATTR_DEVICE_POWER_FAILURE_ALARM,
value=lambda value: "yes" if value is True else "no",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this is not a control but a sensor, should the states be "muted" and "unmuted"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is a physical mute button on the device, This entity is used to show whether the device is in silent mode

YoLinkSensorEntityDescription(
key="sound",
device_class=SensorDeviceClass.ENUM,
name="Volume",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above about this possibly being too vague

YoLinkSensorEntityDescription(
key="beep",
device_class=SensorDeviceClass.ENUM,
name="Beep",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above about this possibly being too vague

icon="mdi:bullhorn",
options=["enable", "disable"],
exists_fn=lambda device: device.device_type in ATTR_DEVICE_POWER_FAILURE_ALARM,
value=lambda value: "enable" if value is True else "disable",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this is not a control but a sensor, should the states be "enabled" and "disabled"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Our API does not support change the settings of the beeper, but the mobile application can , this entity is used to display the status of the beeper

@home-assistant home-assistant Bot marked this pull request as draft May 24, 2023 12:51
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@matrixd2 matrixd2 marked this pull request as ready for review May 24, 2023 14:34
@home-assistant home-assistant Bot requested a review from emontnemery May 24, 2023 14:34
Copy link
Copy Markdown
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

Thanks, @matrixd2 👍

@emontnemery emontnemery merged commit e744632 into home-assistant:dev May 25, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants