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

Create a new python script for updating foreground/background colors #23

Merged

Conversation

rohankapoorcom
Copy link
Contributor

Hey @aderusha,

In the same vein as my previous simplifications for updating font size/text (#17, #19), I've also written a python_script to simplify the logic of picking colors. This allows setting the foreground/background color in one service call rather than doing this separately in each automation that needs to do it.

Here's an example:

Before:

    - service: mqtt.publish
      data:
        topic: 'hasp/plate01/command/p[9].b[4].bco'
        payload: '5285'

    - service: mqtt.publish
      data:
        topic: 'hasp/plate01/command/p[9].b[4].pco'
        payload: '65535'

After:

    - service: python_script.hasp_update_colors
      data:
        nodename: plate01
        object_id: 'p[9].b[4]'
        background: '5285'
        foreground: '65535'

I'd recommend merging this in after #19 since it also requires setting up the python_script component and (copying in the scripts) that is demonstrated there. Once that's merged, this will also require a small documentation update and a change to deployhasp.sh to download and grab the new script as well.

@rohankapoorcom rohankapoorcom mentioned this pull request Sep 8, 2018
@aderusha aderusha changed the base branch from dev to python_script September 18, 2018 03:19
@aderusha
Copy link
Owner

merging into new branch python_script for continued testing

@aderusha aderusha closed this Sep 18, 2018
@aderusha aderusha reopened this Sep 18, 2018
@aderusha aderusha merged commit b321dac into aderusha:python_script Sep 18, 2018
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