Commit Graph

8 Commits

Author SHA1 Message Date
Mateusz Filipowicz
325d7b7f20 feat: initialize Terraform Plugin Framework (#23)
* feat: initialize Terraform Plugin Framework

* fix docker-compose path for tests

* fix: ensure documentation can be generated with old provider SDK and new plugin framework

* lint
2025-02-24 00:11:41 +01:00
Jamie Wark
65e1701bc5 Add wlan tuning (#312)
* Add wlan tuning

* proxy_arp
* bss_transition
* fast_roaming_enabled

* Fix punctuation

* Default `bss_transition` to `true`

* Improve tests

* Tweak descriptions

* Fix tests

* Fix tests

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-10 14:15:35 +11:00
Paul Tyng
0401ae6913 Add support for port aggregation (#182)
* Add support for port aggregation

Fixes #142

* Return `*unifi.Device` from `allocateDevice`

* Merge `TestAccDevice_switch_portOverrides` and `TestAccDevice_remove_portOverrides`

* Add tests

Note that only switches with a Broadcom, Microsemi or Nephos chipset support both port mirroring and port aggregation.

```java
package com.ubnt.data;

public class Device extends X implements Sanitizable
{

  // ...

  public int getMaxMirrorSession() {
    int n = 0;
    if (this.getModel() == Model.\u00f8\u00f50000) {
      n = 2;
    }
    else if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isMediaTekSwitch() || this.isNephosSwitch()) {
      n = 1;
    }
    return this.thisforObject().getInt("max_mirror_sessions", n);
  }

  public int getMaxAggregation() {
    int n = 0;
    if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isNephosSwitch()) {
      n = 6;
    }
    return this.thisforObject().getInt("max_aggregate_sessions", n);
  }

  // ...

  public boolean isBroadcomSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00f400000) && model.getType() == DeviceType.if;
  }

  public boolean isMicrosemiSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.o00000) && model.getType() == DeviceType.if;
  }

  public boolean isMediaTekSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d3O0000) && model.getType() == DeviceType.if;
  }

  public boolean isNephosSwitch() {
    final Model model = this.getModel();
    return model.getChipset().typeOf(Chipset.\u00d5O0000) && model.getType() == DeviceType.if;
  }

  // ...

}
```

To extract the list of models that use one of these chipsets I used the following script (executed as `java --class-path path/to/ace.jar main.java`):

```java
import com.ubnt.data.Model;

class UniFiModels {
  public static void main(String[] args) {
    /*
    for (Model model : Model.values()) {
      System.out.printf(
          "Model = %s\nSKU = %s\nType = %s\nFeatures = %s\nChipset = %s\nSysId = %s\nPortNum = %s\n\n",
          model,
          model.getSku(),
          model.getType(),
          model.getFeatures(),
          model.getChipset(),
          model.getSysId(),
          model.getPortNum());
    }
    */

    for (Model model : Model.values()) {
      System.out.printf("%s: %s (%s)\n", model.getChipset(), model, model.getSku());
    }
  }
}

```

---------

Co-authored-by: Joshua Spence <josh@spence.com.au>
2023-03-08 18:02:34 +11:00
Joshua Spence
2eba55a7f3 Change default value for allow_adoption (#317)
* Change default value for `allow_adoption`

* Update docs
2023-02-28 22:19:22 +11:00
Joshua Spence
b3662a627f Fix network mDNS acceptance tests (#311)
* Make compatible with `getTestVLAN`

* Run `go generate`
2023-02-25 10:18:49 +11:00
Paul Tyng
d02c97bd55 Updates for controller v7.1 and dependency updates 2022-07-02 22:02:22 -04:00
Paul Tyng
118f612b49 Modify device a little to allow creation, add basic testing 2021-03-27 16:58:23 -04:00
wolf-cosmose
051ed9875e Add rudimentary support for resource unifi_device (#112) 2021-03-20 22:38:32 -04:00