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

Separate Notify from NotifyPayload, support for mqtt text type, other Notification fixes #28

Merged
merged 13 commits into from
Jan 26, 2023

Conversation

infeeeee
Copy link
Collaborator

Separated payload based notify from classic notify. The reason: there is a new mqtt entity supported by HomeAssistant: MQTT Text: https://www.home-assistant.io/integrations/text.mqtt/

With this changes you can send custom notification directly from home assistant webui!
image

The format accepted: Title|Message. If there is no | character it will display everything as the title.

Also with this changes the config check working again for classic notify, it gives a warning if no predefined title and message found.

@infeeeee infeeeee changed the title Sepsrste Notify from NotifyPayload, support for mqtt text type Separate Notify from NotifyPayload, support for mqtt text type Dec 16, 2022
@infeeeee
Copy link
Collaborator Author

Changed Windows notification module to tinyWinToast

Reasons:

  • Win10toast was giving me strange warnings
  • With this module it's possible to change the name of the sending app, on win10toast it showed Python, now it's IoTuring
  • Win10toast only supports icons in .ico format, this supports pngs

For the icon, I just downloaded an official home-asssistant icon from here https://github.com/home-assistant/assets/blob/master/logo/logo-small.png

If IoTuring would have a logo, I would replace it.

@infeeeee
Copy link
Collaborator Author

Also removed notif2 dependency, as it is also deprecated: https://notify2.readthedocs.io/en/latest/#notify2-api-documentation

This package required most of the other linux prerequisites, so it makes installation much more streamlined.

notify-send is installed with libnotify, used by all des, so if someone uses a gui on linux, it should be installed. On a terminal only install than it will fail on PostInitialize()

@infeeeee infeeeee changed the title Separate Notify from NotifyPayload, support for mqtt text type Separate Notify from NotifyPayload, support for mqtt text type, other Notification fixes Dec 19, 2022
@richibrics
Copy link
Owner

richibrics commented Jan 10, 2023

Hi, I liked so much your edits to work with HomeAssistant new Text component.
However I thought that separation of the Notify entity would have caused some confusion so I think this is the best solution: if configuring it, title and message are provided, those will be used; otherwise the Text component of HASS will be displayed (it becomes a NotifyPayload).

@infeeeee
Copy link
Collaborator Author

I think you can pull this, I don't want to add anything else 🚀

@richibrics richibrics merged commit cf8ebfb into richibrics:main Jan 26, 2023
@infeeeee infeeeee deleted the notifypayload branch January 26, 2023 18:05
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.

None yet

2 participants