The009/SmartSwitchPHPController

Having dimming issue when there are two or more HS220 dimmer switch

Closed this issue · 1 comments

Change the code to this for dimmer slider and comment out the default ajax request, then it works.
And thanks for creating this fantastic project!

      <form id="form{$i}">
      <input id="deviceIP" name="ip" type="hidden" value="{$item["deviceIP"]}" />
      <input id="devicePort" name="port" type="hidden" value="{$item["devicePort"]}" />
      <input id="action" name="action" type="hidden" value="dimmerAdjust" />
      <input id="deviceType" name="deviceType" type="hidden" value="{$item["deviceType"]}" />
      <input id="dimmverValue{$i}" name="dimmerValue" type="range" min="1" max="100" step="1" value="50" />
      </form>
      </div>
      <script>
      $( document ).ready(function() {
      $("#dimmverValue{$i}").change(function() {
        $.ajax({
          url: 'send.php',
          type: 'get',
          data: $("#form{$i}").serialize(),
          success: function(response){
            console.log("Enable debug in send.php for response");
            console.log( response );
          }
        });
      });
    });
    </script>

I do not have 2 dimmers myself to test this, but the code looks good.

Thank you very much for your time and effort in contributing to make it better, I will put it into a beta for people to test out.

I had no idea anyone else was actually using this, I just can't stand things calling home so this was made to negate that. I am glad it is helping you.