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

Use API-defined switch names instead of channel indices #22

Merged
merged 2 commits into from
Nov 11, 2019
Merged

Use API-defined switch names instead of channel indices #22

merged 2 commits into from
Nov 11, 2019

Conversation

twhittock
Copy link
Contributor

Resolves #14 partly, not sure about the icon thing. Recommendation in Entity documentation (https://developers.home-assistant.io/docs/en/entity_index.html#advanced-properties) is to not mess with it without good reason.

@albertogeniola albertogeniola merged commit fa1976f into albertogeniola:master Nov 11, 2019
@ping-localhost
Copy link

ping-localhost commented Nov 11, 2019

Thank you @twhittock for resolving my issue. 😁


The icons were just hardcoded to make it match with the actual type:

    @property
    def icon(self) -> str:
        """Return the icon to use for device."""
        if self.type.lower() == 'usb':
            return 'mdi:usb'
        elif self.type.lower() == 'switch':
            return 'mdi:power-socket'
        else:
            return 'mdi:flash'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] Added custom name for plug as friendly_name
3 participants