From e2ffee1deaa29fbef8a67df7df63fba2611c3230 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 17 Nov 2023 21:54:41 +0100 Subject: [PATCH] Version 1.3.0 - Preparation for weather module - weather icons added. - .show_message service reworked - it is now possible to show multiple texts and images at once! - Light entity has been revised here the old one must be deleted! - The entire custom component has been tidied up a bit more clearly. --- README.md | 24 ++-- custom_components/divoom_pixoo/__init__.py | 17 +-- .../divoom_pixoo/img/weather/cloudy.png | Bin 0 -> 1767 bytes .../divoom_pixoo/img/weather/exceptional.png | Bin 0 -> 1955 bytes .../divoom_pixoo/img/weather/fog.png | Bin 0 -> 1766 bytes .../divoom_pixoo/img/weather/frost.png | Bin 0 -> 1742 bytes .../divoom_pixoo/img/weather/humidity.png | Bin 0 -> 1755 bytes .../divoom_pixoo/img/weather/lightning.png | Bin 0 -> 1774 bytes .../divoom_pixoo/img/weather/partlycloudy.png | Bin 0 -> 1758 bytes .../divoom_pixoo/img/weather/rainy.png | Bin 0 -> 1769 bytes .../divoom_pixoo/img/weather/snowy.png | Bin 0 -> 1771 bytes .../divoom_pixoo/img/weather/sunny.png | Bin 0 -> 1756 bytes .../divoom_pixoo/img/weather/windy.png | Bin 0 -> 1760 bytes custom_components/divoom_pixoo/light.py | 23 +++- .../divoom_pixoo/schemas/channel_schema.py | 6 + .../divoom_pixoo/schemas/clockid_schema.py | 6 + .../divoom_pixoo/schemas/image_schema.py | 7 ++ .../divoom_pixoo/schemas/page_schema.py | 17 +++ .../divoom_pixoo/schemas/pv_schema.py | 12 ++ .../divoom_pixoo/schemas/text_schema.py | 9 ++ custom_components/divoom_pixoo/sensor.py | 113 ++++++++++-------- 21 files changed, 161 insertions(+), 73 deletions(-) create mode 100644 custom_components/divoom_pixoo/img/weather/cloudy.png create mode 100644 custom_components/divoom_pixoo/img/weather/exceptional.png create mode 100644 custom_components/divoom_pixoo/img/weather/fog.png create mode 100644 custom_components/divoom_pixoo/img/weather/frost.png create mode 100644 custom_components/divoom_pixoo/img/weather/humidity.png create mode 100644 custom_components/divoom_pixoo/img/weather/lightning.png create mode 100644 custom_components/divoom_pixoo/img/weather/partlycloudy.png create mode 100644 custom_components/divoom_pixoo/img/weather/rainy.png create mode 100644 custom_components/divoom_pixoo/img/weather/snowy.png create mode 100644 custom_components/divoom_pixoo/img/weather/sunny.png create mode 100644 custom_components/divoom_pixoo/img/weather/windy.png create mode 100644 custom_components/divoom_pixoo/schemas/channel_schema.py create mode 100644 custom_components/divoom_pixoo/schemas/clockid_schema.py create mode 100644 custom_components/divoom_pixoo/schemas/image_schema.py create mode 100644 custom_components/divoom_pixoo/schemas/page_schema.py create mode 100644 custom_components/divoom_pixoo/schemas/pv_schema.py create mode 100644 custom_components/divoom_pixoo/schemas/text_schema.py diff --git a/README.md b/README.md index dc43b60..5acb8c3 100644 --- a/README.md +++ b/README.md @@ -125,22 +125,24 @@ If you have any further questions, I will be happy to help. You can use it for Push Notifications. ``` -alias: Pixoo Notification -description: "" +alias: YOUR TITEL trigger: - - platform: state - entity_id: - - event.ANY-EVENT -condition: [] + - platform: YOUR PLATFORM + e.g. entity_id: YOUR ENTITY action: - service: divoom_pixoo.show_message data: entity_id: sensor.divoom_pixoo - message: HELLO WORLD - position: [0,0] - color: [255, 0, 255] - font: FONT_GICKO -mode: single + #If you want draw more than 1 Message u have to need more positions, colors and fonts too + messages: ["Message 1", "Message 2"] + positions: [[1, 1], [1, 20]] + colors: [[255, 0, 0], [0, 255, 0]] + fonts: ["FONT_GICKO", "FONT_PICO_8"] + #same as Messages at images u need for each image an image_positions + images : ["/config/custom_components/divoom_pixoo/img/sunpower.png", + "/config/custom_components/divoom_pixoo/img/haus.png"] + image_positions : [[1, 30], + [20, 30]] ``` ## Font diff --git a/custom_components/divoom_pixoo/__init__.py b/custom_components/divoom_pixoo/__init__.py index b7b5d63..6170198 100644 --- a/custom_components/divoom_pixoo/__init__.py +++ b/custom_components/divoom_pixoo/__init__.py @@ -7,6 +7,7 @@ from homeassistant.helpers import config_validation as cv DOMAIN = "divoom_pixoo" +VERSION = "1.2.0" async def async_setup(hass: HomeAssistant, config: dict): @@ -37,16 +38,16 @@ async def async_setup(hass: HomeAssistant, config: dict): async def async_show_message(service: ServiceCall): """Handle the service call to show a message on the Pixoo device.""" entity_id = service.data.get('entity_id') - message = service.data.get('message') - position = service.data.get('position') - color = service.data.get('color') - font = service.data.get('font') - image = service.data.get('image') - image_position = service.data.get('image_position') - + messages = service.data.get('messages') + positions = service.data.get('positions') + colors = service.data.get('colors') + fonts = service.data.get('fonts') + images = service.data.get('images', []) + image_positions = service.data.get('image_positions', []) + ... for entity in hass.data[DOMAIN].get('entities', []): if entity.entity_id == entity_id: - await entity.async_show_message(message, position, color, font, image, image_position) + await entity.async_show_message(messages, positions, colors, fonts, images, image_positions) break # Service registrieren diff --git a/custom_components/divoom_pixoo/img/weather/cloudy.png b/custom_components/divoom_pixoo/img/weather/cloudy.png new file mode 100644 index 0000000000000000000000000000000000000000..ced4a3601f2572604e6118412506cc21cb794cc2 GIT binary patch literal 1767 zcmah~eM}Q)96lH!e8|*&;V{$7fd<6(?pmn!=z*mz&`1ejk&h7cY_IJJy*uu%QWz$} z7B*(05+_V7Mj6X8=Y~^oV+y$GHk~X^hhKBi5VMTTIZX(fINkQ%6+r~IKd!y^_dLJn z_w~N-HRtDL$3(?NK@b#U%`q2({|Nbs2nWBX<_>Iyps;SnULuv)atR0LRZ~uG1FiOZ zd4NNZA;Zs8j!IgBH_&c|C6PPF1`(KXl1Oo?4YTnk+Qa133G|w}JiDW=(xG=E8R=05 zKLG^1v_!#vZxt&NeiBi13GgnPQ3O^fQYDF$*z#c$C(v-JI#rD!=~1vjaJq;>bJm12 zSdoZFl6V3|YierLHCi<%xKUiM*Q1yQ)o4_Jp%QCZiSnyhFwz`2+zfQg0K znXuJj(&2iYPNh)?BY=Ssz?X5=nkfmeG?+%K!f_RzYS-X|Mn|NqOvZ2m!xUwO4bFj+ zlBoaV%exsi01umu$YDf@6KWMxaEq^@tAnfHvWijmHVi8hCMbv8Bog5T&gpZ|P9->y z3!)Y{HoC!ZNyO-KF`%8bFgP}ho23O9SL2vkH{GemLj%EQmxoRyhsp=;adrlD zM*aqc@WcrPenA^J`QQpcC+`rjn7oB(7F<07xMS)PJg-AgNCN{VGh-qUl-S~HIlDU3 z_|jX0J&A|0Ll$Fn^Tu6Nc;Oy6e)*0F?P%}$Tgi8;`-&r(g*`D*ox1*4#$$(dp4Y-G z^Uc@FVtbSNIzDcEp|(l;+nyUk`k_F`>ckJa#z&4{ z{|s)vcr$*lFs@si(!b!_?2ME_|5DAnC!TqFZTUe=RL9 zFYZ0PsGK!k-Whl4>m_HFvCZF&Jeu=!+llJvPm+J#TXavq`OP1j>MzFpvG~N6z~|k6 zho;B5e@Z$%KN5T_BKe$B5rU#$l%Ei&J+J^63#?|NeZj7d?Vm+L_?+j?jX4{KD~7jr z-3wdvRq4rfhK5xa9LQlOP=}D%=L}`0xMHr*8l(j literal 0 HcmV?d00001 diff --git a/custom_components/divoom_pixoo/img/weather/exceptional.png b/custom_components/divoom_pixoo/img/weather/exceptional.png new file mode 100644 index 0000000000000000000000000000000000000000..d23c6eb950d08191a612f3d27ea6fc840745b369 GIT binary patch literal 1955 zcmah~eQXnD7{4*VZ7?=q0mKiEt5Fhcuf4fK&)!C92P@E~bX(Rfg>Y-%wzpmHj=L-E z7N^7k8w?497}!EYh9H8vETk9_1P6vMMVK;y-~u5EQ9%O%F%s~->%Pi{{&9DG-skuH zp67kOy4K~KpP4Z=13{2Xdy&lzziG;oHX6Qmg$_L=-xL4Jlg zMnZxxkZCj)W;uzBQJBh0!r#g|}8<2b=BghQTp$aEm z$wy=g!=N7RCHMRKxrK7fc+kXdqml1eck> zQ{akb2wVv9GB1UAp+Bf37yarXhA`d3o5W~gIIzR<-|%oa=^Bz;xB@1ww+Klw^*NAA zY6O70fy75dA1GV_v!_uLr{slnF)_e;Yz$1Q1gk+|v!BqF53jTGEH4(r76cS#P)(G) zk@heh1Z9k04)rk&94`V~@QHIJDmJ3DK`F<;dk_Omo&g<&%_8tYPRfT>_1Az@V{`C+ z7+S7MIH0mytuB!dFf7zb?)h_3d!f~6Fd2D;- zgq|b_@-@Ruy@Ay0Rb~|p=f+RV^#9?N?nljjA1O033sfmF4Hi~TNC}Z;lo23VnhR1` zOzQ^$I>O3WeiXGoIwa3`2A{$Rb9Pd9h}Y*J7|d*{eEy zD5|y;N&A$lP?#X{{)i9w)!V}O6IzK6$WdAZmLTjV3bOd1f@;Sok5V4 zl?-f!AuWI)GnymKXBN)2_^aaISjik7ZY{i|rG- zjG>u1ws5WXSA0+S9GSKbYdjFwRTYb`myObhYoxQYj&8>R#9c>k zRCp^^#1Ad|u-@5mps{V==C7{4nt9>|H7U1e+}8Ni?f*nC`j#(AS-9`dRc%!@*O+UU z?j5SSvq9LhY2EQv->srry{-pmf7n_2W}d11XMS^BIGNQwjxM`1dH!1+o4Sb3JK~iV z+49j(C*D}Ad2h+qEf;5Y*E<`LeD62<)!P@Zd3JKaX=LeWP+0$P$AU-Cn@*J;-