Skip to content

Commit

Permalink
Add a setting to send full DMX frames, instead of partial ones exclus…
Browse files Browse the repository at this point in the history
…ively. Thanks Gruffalo34!
  • Loading branch information
Breina committed Jan 4, 2023
1 parent fcf5dbc commit 7e64898
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ light:
refresh_every: 0 # Resend values if no fades are running every x seconds, 0 disables automatic refresh
universes: # Support for multiple universes
0: # Nr of Universe (see configuration of your Art-Net Node)
send_partial_universe: True # Only send the universe which contains data
output_correction: quadratic # optional: output correction for the whole universe, will be used as default if nothing is set for the channel
devices:
# Dimmer
Expand Down Expand Up @@ -109,6 +110,7 @@ light:
- **max-fps** (*Optional; default=25*): frame rate for fade update (1 to 40 FPS)
- **refresh_every** (*Optional; default=120*): Seconds to resend values if no fades are running, 0 disables.
- **universe** (*Required*): Art-Net universe for following DMX channels.
- **send_partial_universe** (*Optional; default=True*): Some controllers only accept full DMX frames. Set to `False` to always send the full 512 channels to every universe.
- **output_correction** (*Optional; default=linear*): applied to whole universe
- **'linear'**
- **'quadratic'** (see Graph)
Expand Down
7 changes: 7 additions & 0 deletions custom_components/artnet_led/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
CONF_DEVICE_TRANSITION = ATTR_TRANSITION

CONF_INITIAL_VALUES = "initial_values"
CONF_SEND_PARTIAL_UNIVERSE = "send_partial_universe"

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -169,6 +170,11 @@ async def async_setup_platform(hass: HomeAssistant, config, async_add_devices, d
d.set_initial_brightness(device[CONF_DEVICE_VALUE])

device_list.append(d)

send_partial_universe = universe_cfg[CONF_SEND_PARTIAL_UNIVERSE]
if not send_partial_universe and universe.highest_channel != 512:
universe.add_channel(start=512, width=1, channel_name="Full universe hack")

async_add_devices(device_list)

return True
Expand Down Expand Up @@ -856,6 +862,7 @@ async def restore_state(self, old_state):
vol.Required(CONF_NODE_HOST): cv.string,
vol.Required(CONF_NODE_UNIVERSES): {
vol.All(int, vol.Range(min=0, max=1024)): {
vol.Optional(CONF_SEND_PARTIAL_UNIVERSE, default=True): cv.boolean,
vol.Optional(CONF_OUTPUT_CORRECTION, default=None): vol.Any(
None, vol.In(AVAILABLE_CORRECTIONS)
),
Expand Down

0 comments on commit 7e64898

Please sign in to comment.