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

Change icon of Team Status Sensor to real Teams Icon #80

Merged
merged 6 commits into from
Nov 13, 2022

Conversation

rdeveen
Copy link

@rdeveen rdeveen commented Nov 12, 2022

The icon of the Teams Status Sensor is just the default eye icon. The Teams icon is available in the icons library. This PR will use the Teams Icon in the Teams Status Sensor.

Before
Screenshot 2022-11-12 204337
After
Screenshot 2022-11-12 204702

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 12, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.77%.

Quality metrics Before After Change
Complexity 2.57 ⭐ 2.48 ⭐ -0.09 👍
Method Length 55.76 ⭐ 51.07 ⭐ -4.69 👍
Working memory 6.40 🙂 6.28 🙂 -0.12 👍
Quality 78.05% 78.82% 0.77% 👍
Other metrics Before After Change
Lines 284 296 12
Changed files Quality Before Quality After Quality Change
custom_components/o365/sensor.py 78.05% ⭐ 78.82% ⭐ 0.77% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
custom_components/o365/sensor.py O365QuerySensor.__init__ 2 ⭐ 229 ⛔ 10 😞 54.45% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@RogerSelwyn
Copy link
Owner

I've not tested it, but you can probably use the icon property for this, rather than extra_attributes. Certainly works for media_player not sure if it works for sensor.

    @property
    def icon(self):
        """Entity icon."""
        return SKYQ_ICONS[self._entity_attr.skyq_media_typer]

@rdeveen
Copy link
Author

rdeveen commented Nov 12, 2022

You are right, changed it.

@RogerSelwyn
Copy link
Owner

I'll have a look at this some more tomorrow, and probably add icons for the chat sensor (teams), and the inbox sensors (outlook). I'm just implementing a tasks/todo sensor, so will look if there is anything appropriate for that.

Great idea. Thanks

@rdeveen
Copy link
Author

rdeveen commented Nov 12, 2022

It's my pleasure.

Here are some ideas for other icons.

For Chat: mdi:chat
For Inbox: mdi-email
For Tasks: mdi:bookmark-check or mdi:clipboard-check

@RogerSelwyn RogerSelwyn merged commit 7d7d71c into RogerSelwyn:master Nov 13, 2022
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.

2 participants